aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2009-05-07 09:37:36 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 08:13:10 -0400
commit6818173bd658439b83896a2a7586f64ab51bf29c (patch)
tree17d25ee77485af18da1a80cb7f1d8ec581c6abfc /include
parent7c77f0b3f9208c339a4b40737bb2cb0f0319bb8d (diff)
splice: implement default splice_read method
If f_op->splice_read() is not implemented, fall back to a plain read. Use vfs_readv() to read into previously allocated pages. This will allow splice and functions using splice, such as the loop device, to work on all filesystems. This includes "direct_io" files in fuse which bypass the page cache. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/pipe_fs_i.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5bed436f4353..d926c2bea166 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2204,6 +2204,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2204/* fs/splice.c */ 2204/* fs/splice.c */
2205extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2205extern ssize_t generic_file_splice_read(struct file *, loff_t *,
2206 struct pipe_inode_info *, size_t, unsigned int); 2206 struct pipe_inode_info *, size_t, unsigned int);
2207extern ssize_t default_file_splice_read(struct file *, loff_t *,
2208 struct pipe_inode_info *, size_t, unsigned int);
2207extern ssize_t generic_file_splice_write(struct pipe_inode_info *, 2209extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
2208 struct file *, loff_t *, size_t, unsigned int); 2210 struct file *, loff_t *, size_t, unsigned int);
2209extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, 2211extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index c8f038554e80..b43a9e039059 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -152,5 +152,6 @@ void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void
152void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); 152void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
153int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); 153int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
154int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 154int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
155void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
155 156
156#endif 157#endif