diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-04 22:38:00 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:32:45 -0400 |
commit | a6cbcd4a4a85e2fdb0b3344b88df2e8b3d526b9e (patch) | |
tree | c0f054759a0b9c26881109968ad018fe759af458 /fs/nfs/direct.c | |
parent | 16b1f05d7f5ab4ce570963aca5f3b2b5d21822fa (diff) |
get rid of pointless iov_length() in ->direct_IO()
all callers have iov_length(iter->iov, iter->nr_segs) == iov_iter_count(iter)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 21723149668..1d34f454989 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -486,9 +486,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, struct nfs_direct_req *dreq; struct nfs_lock_context *l_ctx; ssize_t result = -EINVAL; - size_t count; - - count = iov_length(iter->iov, iter->nr_segs); + size_t count = iov_iter_count(iter); nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n", @@ -877,7 +875,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, get_dreq(dreq); atomic_inc(&inode->i_dio_count); - NFS_I(dreq->inode)->write_io += iov_length(iter->iov, iter->nr_segs); + NFS_I(dreq->inode)->write_io += iov_iter_count(iter); for (seg = 0; seg < iter->nr_segs; seg++) { const struct iovec *vec = &iter->iov[seg]; result = nfs_direct_write_schedule_segment(&desc, vec, pos, uio); @@ -936,9 +934,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter, struct nfs_direct_req *dreq; struct nfs_lock_context *l_ctx; loff_t end; - size_t count; - - count = iov_length(iter->iov, iter->nr_segs); + size_t count = iov_iter_count(iter); end = (pos + count - 1) >> PAGE_CACHE_SHIFT; nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); |