diff options
author | Jens Axboe <axboe@suse.de> | 2006-03-30 08:16:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-30 15:28:18 -0500 |
commit | 5abc97aa25b2c41413b3a520faee83f2282d9f18 (patch) | |
tree | 4ba13ae0e91f15d02986df7cdca5e9455212d7d4 /fs/pipe.c | |
parent | 5274f052e7b3dbd81935772eb551dfd0325dfa9d (diff) |
[PATCH] splice: add support for SPLICE_F_MOVE flag
This enables the caller to migrate pages from one address space page
cache to another. In buzz word marketing, you can do zero-copy file
copies!
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -121,11 +121,19 @@ static void anon_pipe_buf_unmap(struct pipe_inode_info *info, struct pipe_buffer | |||
121 | kunmap(buf->page); | 121 | kunmap(buf->page); |
122 | } | 122 | } |
123 | 123 | ||
124 | static int anon_pipe_buf_steal(struct pipe_inode_info *info, | ||
125 | struct pipe_buffer *buf) | ||
126 | { | ||
127 | buf->stolen = 1; | ||
128 | return 0; | ||
129 | } | ||
130 | |||
124 | static struct pipe_buf_operations anon_pipe_buf_ops = { | 131 | static struct pipe_buf_operations anon_pipe_buf_ops = { |
125 | .can_merge = 1, | 132 | .can_merge = 1, |
126 | .map = anon_pipe_buf_map, | 133 | .map = anon_pipe_buf_map, |
127 | .unmap = anon_pipe_buf_unmap, | 134 | .unmap = anon_pipe_buf_unmap, |
128 | .release = anon_pipe_buf_release, | 135 | .release = anon_pipe_buf_release, |
136 | .steal = anon_pipe_buf_steal, | ||
129 | }; | 137 | }; |
130 | 138 | ||
131 | static ssize_t | 139 | static ssize_t |