aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-05 22:53:04 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:32:49 -0400
commited978a811ec528dbe40243605c3afab55892f722 (patch)
tree7b8b83a755286192b98bb7921fa4d6957709216e /fs
parent23faa7b8db9be0be4f158cfc558460bb95d9b245 (diff)
new helper: generic_file_read_iter()
iov_iter-using variant of generic_file_aio_read(). Some callers converted. Note that it's still not quite there for use as ->read_iter() - we depend on having zero iter->iov_offset in O_DIRECT case. Fortunately, that's true for all converted callers (and for generic_file_aio_read() itself). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/file.c15
-rw-r--r--fs/nfs/file.c2
2 files changed, 2 insertions, 15 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index d8f383d59449..910a3022eb27 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -833,24 +833,11 @@ again:
833 /* hmm, this isn't really async... */ 833 /* hmm, this isn't really async... */
834 ret = ceph_sync_read(iocb, &i, &checkeof); 834 ret = ceph_sync_read(iocb, &i, &checkeof);
835 } else { 835 } else {
836 /*
837 * We can't modify the content of iov,
838 * so we only read from beginning.
839 *
840 * When we switch generic_file_aio_read() to iov_iter, the
841 * if () below will be removed -- AV
842 */
843 if (read) {
844 iocb->ki_pos = pos;
845 len = iocb->ki_nbytes;
846 read = 0;
847 iov_iter_init(&i, iov, nr_segs, len, 0);
848 }
849 dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n", 836 dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n",
850 inode, ceph_vinop(inode), pos, (unsigned)len, 837 inode, ceph_vinop(inode), pos, (unsigned)len,
851 ceph_cap_string(got)); 838 ceph_cap_string(got));
852 839
853 ret = generic_file_aio_read(iocb, iov, nr_segs, pos); 840 ret = generic_file_read_iter(iocb, &i);
854 } 841 }
855 dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n", 842 dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
856 inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret); 843 inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 3d01b152894e..a352bc6d613f 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -184,7 +184,7 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
184 184
185 result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); 185 result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping);
186 if (!result) { 186 if (!result) {
187 result = generic_file_aio_read(iocb, iov, nr_segs, pos); 187 result = generic_file_read_iter(iocb, &to);
188 if (result > 0) 188 if (result > 0)
189 nfs_add_stats(inode, NFSIOS_NORMALREADBYTES, result); 189 nfs_add_stats(inode, NFSIOS_NORMALREADBYTES, result);
190 } 190 }