* 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:
@@ -152,18 +152,21 @@ class Inode {
|
|||||||
timespec CreationTime() const { return fCreationTime; }
|
timespec CreationTime() const { return fCreationTime; }
|
||||||
void SetCreationTime(timespec creationTime)
|
void SetCreationTime(timespec creationTime)
|
||||||
{ fCreationTime = creationTime; }
|
{ fCreationTime = creationTime; }
|
||||||
timespec ModificationTime() const { return fModificationTime; }
|
timespec ModificationTime() const
|
||||||
|
{ return fModificationTime; }
|
||||||
void SetModificationTime(timespec modificationTime)
|
void SetModificationTime(timespec modificationTime)
|
||||||
{ fModificationTime = modificationTime; }
|
{ fModificationTime = modificationTime; }
|
||||||
|
|
||||||
mutex* RequestLock() { return &fRequestLock; }
|
mutex* RequestLock() { return &fRequestLock; }
|
||||||
|
|
||||||
status_t WriteDataToBuffer(const void *data, size_t *_length,
|
status_t WriteDataToBuffer(const void* data,
|
||||||
bool nonBlocking);
|
size_t* _length, bool nonBlocking);
|
||||||
status_t ReadDataFromBuffer(void* data, size_t* _length,
|
status_t ReadDataFromBuffer(void* data, size_t* _length,
|
||||||
bool nonBlocking, ReadRequest& request);
|
bool nonBlocking, ReadRequest& request);
|
||||||
size_t BytesAvailable() const { return fBuffer.Readable(); }
|
size_t BytesAvailable() const
|
||||||
size_t BytesWritable() const { return fBuffer.Writable(); }
|
{ return fBuffer.Readable(); }
|
||||||
|
size_t BytesWritable() const
|
||||||
|
{ return fBuffer.Writable(); }
|
||||||
|
|
||||||
void AddReadRequest(ReadRequest& request);
|
void AddReadRequest(ReadRequest& request);
|
||||||
void RemoveReadRequest(ReadRequest& request);
|
void RemoveReadRequest(ReadRequest& request);
|
||||||
@@ -179,8 +182,10 @@ class Inode {
|
|||||||
int32 ReaderCount() const { return fReaderCount; }
|
int32 ReaderCount() const { return fReaderCount; }
|
||||||
int32 WriterCount() const { return fWriterCount; }
|
int32 WriterCount() const { return fWriterCount; }
|
||||||
|
|
||||||
status_t Select(uint8 event, selectsync *sync, int openMode);
|
status_t Select(uint8 event, selectsync* sync,
|
||||||
status_t Deselect(uint8 event, selectsync *sync, int openMode);
|
int openMode);
|
||||||
|
status_t Deselect(uint8 event, selectsync* sync,
|
||||||
|
int openMode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
timespec fCreationTime;
|
timespec fCreationTime;
|
||||||
@@ -229,7 +234,8 @@ struct file_cookie {
|
|||||||
|
|
||||||
|
|
||||||
RingBuffer::RingBuffer()
|
RingBuffer::RingBuffer()
|
||||||
: fBuffer(NULL)
|
:
|
||||||
|
fBuffer(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +253,7 @@ RingBuffer::CreateBuffer()
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
fBuffer = create_ring_buffer(PIPEFS_MAX_BUFFER_SIZE);
|
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
|
inline size_t
|
||||||
RingBuffer::Readable() const
|
RingBuffer::Readable() const
|
||||||
{
|
{
|
||||||
return (fBuffer != NULL ? ring_buffer_readable(fBuffer) : 0);
|
return fBuffer != NULL ? ring_buffer_readable(fBuffer) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline size_t
|
inline size_t
|
||||||
RingBuffer::Writable() const
|
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
|
static status_t
|
||||||
@@ -787,7 +793,7 @@ fifo_free_cookie(fs_volume *_volume, fs_vnode *_node, void *_cookie)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
fifo_fsync(fs_volume *_volume, fs_vnode *_v)
|
fifo_fsync(fs_volume* _volume, fs_vnode* _node)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -971,7 +977,7 @@ fifo_deselect(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
|||||||
|
|
||||||
TRACE("fifo_deselect(vnode = %p)\n", _node);
|
TRACE("fifo_deselect(vnode = %p)\n", _node);
|
||||||
Inode* inode = (Inode*)_node->private_node;
|
Inode* inode = (Inode*)_node->private_node;
|
||||||
if (!inode)
|
if (inode == NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
MutexLocker locker(inode->RequestLock());
|
MutexLocker locker(inode->RequestLock());
|
||||||
@@ -980,14 +986,14 @@ fifo_deselect(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
|||||||
|
|
||||||
|
|
||||||
static bool
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
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)
|
const iovec* vecs, size_t count, size_t* _numBytes)
|
||||||
{
|
{
|
||||||
return B_NOT_ALLOWED;
|
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
|
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)
|
off_t pos, const iovec* vecs, size_t count, size_t* _numBytes)
|
||||||
{
|
{
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
@@ -1100,6 +1106,7 @@ static fs_vnode_ops sFIFOVnodeOps = {
|
|||||||
|
|
||||||
} // namespace fifo
|
} // namespace fifo
|
||||||
|
|
||||||
|
|
||||||
using namespace fifo;
|
using namespace fifo;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user