summaryrefslogtreecommitdiff
path: root/fs/fifo.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-04-10 15:18:35 +0200
committerJens Axboe <axboe@suse.de>2006-04-10 15:18:35 +0200
commit3a326a2ce88e71d00ac0d133e314a3342a7709f8 (patch)
tree3a3cf55be19311c04d195e37baec9f49c4015b18 /fs/fifo.c
parent0b749ce3802428007a37870eb51ba3c0bdf90857 (diff)
downloadlinux-stable-3a326a2ce88e71d00ac0d133e314a3342a7709f8.tar.gz
[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 <mingo@elte.hu> Update XFS for the ->splice_read/->splice_write changes. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/fifo.c')
-rw-r--r--fs/fifo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/fifo.c b/fs/fifo.c
index 889f722ee36d..b16e2f597d61 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -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;