aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-03 14:07:25 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:39:38 -0400
commitedaf43694898c5d7deb9a394335c60e888039100 (patch)
tree6d9baefdb05c59985d526e8a33daa93ba5435cac /fs/nfs
parentf5674c31ee1f968606702e82c160d6ae11032ded (diff)
nfs: switch to ->write_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c16
-rw-r--r--fs/nfs/internal.h2
-rw-r--r--fs/nfs/nfs4file.c4
3 files changed, 10 insertions, 12 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 200bdb0779f0..20a18e426bdf 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -634,23 +634,21 @@ static int nfs_need_sync_write(struct file *filp, struct inode *inode)
634 return 0; 634 return 0;
635} 635}
636 636
637ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, 637ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
638 unsigned long nr_segs, loff_t pos)
639{ 638{
640 struct file *file = iocb->ki_filp; 639 struct file *file = iocb->ki_filp;
641 struct inode *inode = file_inode(file); 640 struct inode *inode = file_inode(file);
642 unsigned long written = 0; 641 unsigned long written = 0;
643 ssize_t result; 642 ssize_t result;
644 size_t count = iov_length(iov, nr_segs); 643 size_t count = iov_iter_count(from);
645 struct iov_iter from; 644 loff_t pos = iocb->ki_pos;
646 iov_iter_init(&from, WRITE, iov, nr_segs, count);
647 645
648 result = nfs_key_timeout_notify(file, inode); 646 result = nfs_key_timeout_notify(file, inode);
649 if (result) 647 if (result)
650 return result; 648 return result;
651 649
652 if (file->f_flags & O_DIRECT) 650 if (file->f_flags & O_DIRECT)
653 return nfs_file_direct_write(iocb, &from, pos, true); 651 return nfs_file_direct_write(iocb, from, pos, true);
654 652
655 dprintk("NFS: write(%pD2, %zu@%Ld)\n", 653 dprintk("NFS: write(%pD2, %zu@%Ld)\n",
656 file, count, (long long) pos); 654 file, count, (long long) pos);
@@ -671,7 +669,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
671 if (!count) 669 if (!count)
672 goto out; 670 goto out;
673 671
674 result = generic_file_aio_write(iocb, iov, nr_segs, pos); 672 result = generic_file_write_iter(iocb, from);
675 if (result > 0) 673 if (result > 0)
676 written = result; 674 written = result;
677 675
@@ -941,9 +939,9 @@ EXPORT_SYMBOL_GPL(nfs_setlease);
941const struct file_operations nfs_file_operations = { 939const struct file_operations nfs_file_operations = {
942 .llseek = nfs_file_llseek, 940 .llseek = nfs_file_llseek,
943 .read = new_sync_read, 941 .read = new_sync_read,
944 .write = do_sync_write, 942 .write = new_sync_write,
945 .read_iter = nfs_file_read, 943 .read_iter = nfs_file_read,
946 .aio_write = nfs_file_write, 944 .write_iter = nfs_file_write,
947 .mmap = nfs_file_mmap, 945 .mmap = nfs_file_mmap,
948 .open = nfs_file_open, 946 .open = nfs_file_open,
949 .flush = nfs_file_flush, 947 .flush = nfs_file_flush,
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index e598e4a852ad..a5b36fc6b795 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -324,7 +324,7 @@ ssize_t nfs_file_read(struct kiocb *, struct iov_iter *);
324ssize_t nfs_file_splice_read(struct file *, loff_t *, struct pipe_inode_info *, 324ssize_t nfs_file_splice_read(struct file *, loff_t *, struct pipe_inode_info *,
325 size_t, unsigned int); 325 size_t, unsigned int);
326int nfs_file_mmap(struct file *, struct vm_area_struct *); 326int nfs_file_mmap(struct file *, struct vm_area_struct *);
327ssize_t nfs_file_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 327ssize_t nfs_file_write(struct kiocb *, struct iov_iter *);
328int nfs_file_release(struct inode *, struct file *); 328int nfs_file_release(struct inode *, struct file *);
329int nfs_lock(struct file *, int, struct file_lock *); 329int nfs_lock(struct file *, int, struct file_lock *);
330int nfs_flock(struct file *, int, struct file_lock *); 330int nfs_flock(struct file *, int, struct file_lock *);
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 37a998cae963..549dd49638b2 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -119,9 +119,9 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
119const struct file_operations nfs4_file_operations = { 119const struct file_operations nfs4_file_operations = {
120 .llseek = nfs_file_llseek, 120 .llseek = nfs_file_llseek,
121 .read = new_sync_read, 121 .read = new_sync_read,
122 .write = do_sync_write, 122 .write = new_sync_write,
123 .read_iter = nfs_file_read, 123 .read_iter = nfs_file_read,
124 .aio_write = nfs_file_write, 124 .write_iter = nfs_file_write,
125 .mmap = nfs_file_mmap, 125 .mmap = nfs_file_mmap,
126 .open = nfs4_file_open, 126 .open = nfs4_file_open,
127 .flush = nfs_file_flush, 127 .flush = nfs_file_flush,