diff options
author | Jens Axboe <axboe@suse.de> | 2006-04-11 07:52:07 -0400 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-04-11 07:52:07 -0400 |
commit | b92ce55893745e011edae70830b8bc863be881f9 (patch) | |
tree | e2afd62d2e63d74157905140f5907d07bdfe31b9 /fs/pipe.c | |
parent | 529565dcb1581c9a1e3f6df1c1763ca3e0f0d512 (diff) |
[PATCH] splice: add direct fd <-> fd splicing support
It's more efficient for sendfile() emulation. Basically we cache an
internal private pipe and just use that as the intermediate area for
pages. Direct splicing is not available from sys_splice(), it is only
meant to be used for sendfile() emulation.
Additional patch from Ingo Molnar to avoid the PIPE_BUFFERS loop at
exit for the normal fast path.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -691,12 +691,10 @@ struct pipe_inode_info * alloc_pipe_info(struct inode *inode) | |||
691 | return info; | 691 | return info; |
692 | } | 692 | } |
693 | 693 | ||
694 | void free_pipe_info(struct inode *inode) | 694 | void __free_pipe_info(struct pipe_inode_info *info) |
695 | { | 695 | { |
696 | int i; | 696 | int i; |
697 | struct pipe_inode_info *info = inode->i_pipe; | ||
698 | 697 | ||
699 | inode->i_pipe = NULL; | ||
700 | for (i = 0; i < PIPE_BUFFERS; i++) { | 698 | for (i = 0; i < PIPE_BUFFERS; i++) { |
701 | struct pipe_buffer *buf = info->bufs + i; | 699 | struct pipe_buffer *buf = info->bufs + i; |
702 | if (buf->ops) | 700 | if (buf->ops) |
@@ -707,6 +705,12 @@ void free_pipe_info(struct inode *inode) | |||
707 | kfree(info); | 705 | kfree(info); |
708 | } | 706 | } |
709 | 707 | ||
708 | void free_pipe_info(struct inode *inode) | ||
709 | { | ||
710 | __free_pipe_info(inode->i_pipe); | ||
711 | inode->i_pipe = NULL; | ||
712 | } | ||
713 | |||
710 | static struct vfsmount *pipe_mnt __read_mostly; | 714 | static struct vfsmount *pipe_mnt __read_mostly; |
711 | static int pipefs_delete_dentry(struct dentry *dentry) | 715 | static int pipefs_delete_dentry(struct dentry *dentry) |
712 | { | 716 | { |