* Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37861 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
81fcd71e3a
commit
1ffa502964
|
@ -152,18 +152,21 @@ class Inode {
|
|||
timespec CreationTime() const { return fCreationTime; }
|
||||
void SetCreationTime(timespec creationTime)
|
||||
{ fCreationTime = creationTime; }
|
||||
timespec ModificationTime() const { return fModificationTime; }
|
||||
timespec ModificationTime() const
|
||||
{ return fModificationTime; }
|
||||
void SetModificationTime(timespec modificationTime)
|
||||
{ fModificationTime = modificationTime; }
|
||||
|
||||
mutex* RequestLock() { return &fRequestLock; }
|
||||
|
||||
status_t WriteDataToBuffer(const void *data, size_t *_length,
|
||||
bool nonBlocking);
|
||||
status_t WriteDataToBuffer(const void* data,
|
||||
size_t* _length, bool nonBlocking);
|
||||
status_t ReadDataFromBuffer(void* data, size_t* _length,
|
||||
bool nonBlocking, ReadRequest& request);
|
||||
size_t BytesAvailable() const { return fBuffer.Readable(); }
|
||||
size_t BytesWritable() const { return fBuffer.Writable(); }
|
||||
size_t BytesAvailable() const
|
||||
{ return fBuffer.Readable(); }
|
||||
size_t BytesWritable() const
|
||||
{ return fBuffer.Writable(); }
|
||||
|
||||
void AddReadRequest(ReadRequest& request);
|
||||
void RemoveReadRequest(ReadRequest& request);
|
||||
|
@ -179,8 +182,10 @@ class Inode {
|
|||
int32 ReaderCount() const { return fReaderCount; }
|
||||
int32 WriterCount() const { return fWriterCount; }
|
||||
|
||||
status_t Select(uint8 event, selectsync *sync, int openMode);
|
||||
status_t Deselect(uint8 event, selectsync *sync, int openMode);
|
||||
status_t Select(uint8 event, selectsync* sync,
|
||||
int openMode);
|
||||
status_t Deselect(uint8 event, selectsync* sync,
|
||||
int openMode);
|
||||
|
||||
private:
|
||||
timespec fCreationTime;
|
||||
|
@ -229,7 +234,8 @@ struct file_cookie {
|
|||
|
||||
|
||||
RingBuffer::RingBuffer()
|
||||
: fBuffer(NULL)
|
||||
:
|
||||
fBuffer(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -247,7 +253,7 @@ RingBuffer::CreateBuffer()
|
|||
return B_OK;
|
||||
|
||||
fBuffer = create_ring_buffer(PIPEFS_MAX_BUFFER_SIZE);
|
||||
return (fBuffer != NULL ? B_OK : B_NO_MEMORY);
|
||||
return fBuffer != NULL ? B_OK : B_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
|
@ -304,14 +310,14 @@ RingBuffer::UserRead(void *buffer, ssize_t length)
|
|||
inline size_t
|
||||
RingBuffer::Readable() const
|
||||
{
|
||||
return (fBuffer != NULL ? ring_buffer_readable(fBuffer) : 0);
|
||||
return fBuffer != NULL ? ring_buffer_readable(fBuffer) : 0;
|
||||
}
|
||||
|
||||
|
||||
inline size_t
|
||||
RingBuffer::Writable() const
|
||||
{
|
||||
return (fBuffer != NULL ? ring_buffer_writable(fBuffer) : 0);
|
||||
return fBuffer != NULL ? ring_buffer_writable(fBuffer) : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -704,7 +710,7 @@ Inode::Deselect(uint8 event, selectsync *sync, int openMode)
|
|||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - vnode API
|
||||
|
||||
|
||||
static status_t
|
||||
|
@ -787,7 +793,7 @@ fifo_free_cookie(fs_volume *_volume, fs_vnode *_node, void *_cookie)
|
|||
|
||||
|
||||
static status_t
|
||||
fifo_fsync(fs_volume *_volume, fs_vnode *_v)
|
||||
fifo_fsync(fs_volume* _volume, fs_vnode* _node)
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -971,7 +977,7 @@ fifo_deselect(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
|||
|
||||
TRACE("fifo_deselect(vnode = %p)\n", _node);
|
||||
Inode* inode = (Inode*)_node->private_node;
|
||||
if (!inode)
|
||||
if (inode == NULL)
|
||||
return B_ERROR;
|
||||
|
||||
MutexLocker locker(inode->RequestLock());
|
||||
|
@ -980,14 +986,14 @@ fifo_deselect(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
|||
|
||||
|
||||
static bool
|
||||
fifo_can_page(fs_volume *_volume, fs_vnode *_v, void *cookie)
|
||||
fifo_can_page(fs_volume* _volume, fs_vnode* _node, void* cookie)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static status_t
|
||||
fifo_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
||||
fifo_read_pages(fs_volume* _volume, fs_vnode* _node, void* cookie, off_t pos,
|
||||
const iovec* vecs, size_t count, size_t* _numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
|
@ -995,7 +1001,7 @@ fifo_read_pages(fs_volume *_volume, fs_vnode *_v, void *cookie, off_t pos,
|
|||
|
||||
|
||||
static status_t
|
||||
fifo_write_pages(fs_volume *_volume, fs_vnode *_v, void *cookie,
|
||||
fifo_write_pages(fs_volume* _volume, fs_vnode* _node, void* cookie,
|
||||
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes)
|
||||
{
|
||||
return B_NOT_ALLOWED;
|
||||
|
@ -1100,6 +1106,7 @@ static fs_vnode_ops sFIFOVnodeOps = {
|
|||
|
||||
} // namespace fifo
|
||||
|
||||
|
||||
using namespace fifo;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue