diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-06-01 05:51:43 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-10 02:04:14 -0400 |
commit | f0930fffa99e7fe0a0c4b6c7d9a244dc88288c27 (patch) | |
tree | 16f6b9e5df9e3ef5aa0f8bc096ea22a196f73e44 /fs/nfs | |
parent | fd5821404e6823997666d668f62c76eae228abc9 (diff) |
sendfile: convert nfs to using splice_read()
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 9eb8eb4e4a08..8689b736fdd9 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -41,7 +41,9 @@ static int nfs_file_open(struct inode *, struct file *); | |||
41 | static int nfs_file_release(struct inode *, struct file *); | 41 | static int nfs_file_release(struct inode *, struct file *); |
42 | static loff_t nfs_file_llseek(struct file *file, loff_t offset, int origin); | 42 | static loff_t nfs_file_llseek(struct file *file, loff_t offset, int origin); |
43 | static int nfs_file_mmap(struct file *, struct vm_area_struct *); | 43 | static int nfs_file_mmap(struct file *, struct vm_area_struct *); |
44 | static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | 44 | static ssize_t nfs_file_splice_read(struct file *filp, loff_t *ppos, |
45 | struct pipe_inode_info *pipe, | ||
46 | size_t count, unsigned int flags); | ||
45 | static ssize_t nfs_file_read(struct kiocb *, const struct iovec *iov, | 47 | static ssize_t nfs_file_read(struct kiocb *, const struct iovec *iov, |
46 | unsigned long nr_segs, loff_t pos); | 48 | unsigned long nr_segs, loff_t pos); |
47 | static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov, | 49 | static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov, |
@@ -65,7 +67,7 @@ const struct file_operations nfs_file_operations = { | |||
65 | .fsync = nfs_fsync, | 67 | .fsync = nfs_fsync, |
66 | .lock = nfs_lock, | 68 | .lock = nfs_lock, |
67 | .flock = nfs_flock, | 69 | .flock = nfs_flock, |
68 | .sendfile = nfs_file_sendfile, | 70 | .splice_read = nfs_file_splice_read, |
69 | .check_flags = nfs_check_flags, | 71 | .check_flags = nfs_check_flags, |
70 | }; | 72 | }; |
71 | 73 | ||
@@ -224,20 +226,21 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov, | |||
224 | } | 226 | } |
225 | 227 | ||
226 | static ssize_t | 228 | static ssize_t |
227 | nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count, | 229 | nfs_file_splice_read(struct file *filp, loff_t *ppos, |
228 | read_actor_t actor, void *target) | 230 | struct pipe_inode_info *pipe, size_t count, |
231 | unsigned int flags) | ||
229 | { | 232 | { |
230 | struct dentry *dentry = filp->f_path.dentry; | 233 | struct dentry *dentry = filp->f_path.dentry; |
231 | struct inode *inode = dentry->d_inode; | 234 | struct inode *inode = dentry->d_inode; |
232 | ssize_t res; | 235 | ssize_t res; |
233 | 236 | ||
234 | dfprintk(VFS, "nfs: sendfile(%s/%s, %lu@%Lu)\n", | 237 | dfprintk(VFS, "nfs: splice_read(%s/%s, %lu@%Lu)\n", |
235 | dentry->d_parent->d_name.name, dentry->d_name.name, | 238 | dentry->d_parent->d_name.name, dentry->d_name.name, |
236 | (unsigned long) count, (unsigned long long) *ppos); | 239 | (unsigned long) count, (unsigned long long) *ppos); |
237 | 240 | ||
238 | res = nfs_revalidate_mapping(inode, filp->f_mapping); | 241 | res = nfs_revalidate_mapping(inode, filp->f_mapping); |
239 | if (!res) | 242 | if (!res) |
240 | res = generic_file_sendfile(filp, ppos, count, actor, target); | 243 | res = generic_file_splice_read(filp, ppos, pipe, count, flags); |
241 | return res; | 244 | return res; |
242 | } | 245 | } |
243 | 246 | ||