diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-02-01 14:17:23 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-02-10 08:31:03 -0500 |
commit | 4184dcf2dbde481b34d370e1704f2b91a8c9f0d1 (patch) | |
tree | fed7dd67648a78c00bd687ed38bdd133fe45124a /fs | |
parent | c2459dc46269728e4a080ec8d5a316b2bba2e142 (diff) |
NFS: Fix byte accounting for generic NFS reads
Currently, the NFS I/O counters count the number of bytes requested
by applications, rather than the number of bytes actually read by the
system calls.
The number of bytes requested for reads is actually not that useful,
because the value is usually a buffer size for reads. That is, that
requested number is usually a maximum, and frequently doesn't reflect
the actual number of bytes read.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 57cf94f129ba..7f4910c98c7c 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -262,9 +262,11 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov, | |||
262 | (unsigned long) count, (unsigned long) pos); | 262 | (unsigned long) count, (unsigned long) pos); |
263 | 263 | ||
264 | result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); | 264 | result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); |
265 | nfs_add_stats(inode, NFSIOS_NORMALREADBYTES, count); | 265 | if (!result) { |
266 | if (!result) | ||
267 | result = generic_file_aio_read(iocb, iov, nr_segs, pos); | 266 | result = generic_file_aio_read(iocb, iov, nr_segs, pos); |
267 | if (result > 0) | ||
268 | nfs_add_stats(inode, NFSIOS_NORMALREADBYTES, result); | ||
269 | } | ||
268 | return result; | 270 | return result; |
269 | } | 271 | } |
270 | 272 | ||