summaryrefslogtreecommitdiff
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-05 06:53:33 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-07 01:32:44 +0400
commit619d30b4b8c488042b4a720ca79dccc346d1a516 (patch)
tree70877e3e8e2e47032512bc49d9e23cabd33c0f3b /fs/nfs/file.c
parentd8d3d94b80aa1a1c0ca75c58b8abdc7356f38418 (diff)
downloadlinux-619d30b4b8c488042b4a720ca79dccc346d1a516.tar.xz
convert the guts of nfs_direct_IO() to iov_iter
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 284ca901fe16..3d01b152894e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -169,14 +169,18 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
struct inode *inode = file_inode(iocb->ki_filp);
+ size_t count = iov_length(iov, nr_segs);
ssize_t result;
+ struct iov_iter to;
+
+ iov_iter_init(&to, iov, nr_segs, count, 0);
if (iocb->ki_filp->f_flags & O_DIRECT)
- return nfs_file_direct_read(iocb, iov, nr_segs, pos, true);
+ return nfs_file_direct_read(iocb, &to, pos, true);
- dprintk("NFS: read(%pD2, %lu@%lu)\n",
+ dprintk("NFS: read(%pD2, %zu@%lu)\n",
iocb->ki_filp,
- (unsigned long) iov_length(iov, nr_segs), (unsigned long) pos);
+ count, (unsigned long) pos);
result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping);
if (!result) {
@@ -643,16 +647,18 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long written = 0;
ssize_t result;
size_t count = iov_length(iov, nr_segs);
+ struct iov_iter from;
+ iov_iter_init(&from, iov, nr_segs, count, 0);
result = nfs_key_timeout_notify(file, inode);
if (result)
return result;
if (file->f_flags & O_DIRECT)
- return nfs_file_direct_write(iocb, iov, nr_segs, pos, true);
+ return nfs_file_direct_write(iocb, &from, pos, true);
- dprintk("NFS: write(%pD2, %lu@%Ld)\n",
- file, (unsigned long) count, (long long) pos);
+ dprintk("NFS: write(%pD2, %zu@%Ld)\n",
+ file, count, (long long) pos);
result = -EBUSY;
if (IS_SWAPFILE(inode))