[PATCH] introduce a "kernel-internal pipe object" abstraction

separate out the 'internal pipe object' abstraction, and make it
usable to splice. This cleans up and fixes several aspects of the
internal splice APIs and the pipe code:

 - pipes: the allocation and freeing of pipe_inode_info is now more symmetric
   and more streamlined with existing kernel practices.

 - splice: small micro-optimization: less pointer dereferencing in splice
   methods

Signed-off-by: Ingo Molnar <[email protected]>

Update XFS for the ->splice_read/->splice_write changes.

Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Ingo Molnar 2006-04-10 15:18:35 +02:00 • committed by Jens Axboe
commit 3a326a2ce8
9 changed files with 114 additions and 106 deletions

View file

@ -15,12 +15,13 @@
#include <linux/fs.h>
#include <linux/pipe_fs_i.h>
static void wait_for_partner(struct inode* inode, unsigned int* cnt)
static void wait_for_partner(struct inode* inode, unsigned int *cnt)
{
int cur = *cnt;
while(cur == *cnt) {
pipe_wait(inode);
if(signal_pending(current))
while (cur == *cnt) {
pipe_wait(inode->i_pipe);
if (signal_pending(current))
break;
}
}
@ -37,7 +38,8 @@ static int fifo_open(struct inode *inode, struct file *filp)
mutex_lock(PIPE_MUTEX(*inode));
if (!inode->i_pipe) {
ret = -ENOMEM;
if(!pipe_new(inode))
inode->i_pipe = alloc_pipe_info(inode);
if (!inode->i_pipe)
goto err_nocleanup;
}
filp->f_version = 0;