All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] NFSv41: fix DIO write_io calculation
@ 2012-08-08  1:49 Peng Tao
  2012-08-08  1:49 ` [PATCH 2/2] NFS41: fix error of setting blocklayoutdriver Peng Tao
  2012-08-08 19:03 ` [PATCH 1/2] NFSv41: fix DIO write_io calculation Myklebust, Trond
  0 siblings, 2 replies; 8+ messages in thread
From: Peng Tao @ 2012-08-08  1:49 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs, Andy Adamson

pnfs_within_mdsthreshold() is called inside pg_init. We need
to set read_io/write_io before that.

Cc: Andy Adamson <andros@netapp.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
---
 fs/nfs/direct.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 1ba385b..34a6282 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -463,10 +463,10 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
 	if (!is_sync_kiocb(iocb))
 		dreq->iocb = iocb;
 
+	NFS_I(inode)->read_io += iov_length(iov, nr_segs);
 	result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos, uio);
 	if (!result)
 		result = nfs_direct_wait(dreq);
-	NFS_I(inode)->read_io += result;
 out_release:
 	nfs_direct_req_release(dreq);
 out:
@@ -814,6 +814,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(iov, nr_segs);
 	for (seg = 0; seg < nr_segs; seg++) {
 		const struct iovec *vec = &iov[seg];
 		result = nfs_direct_write_schedule_segment(&desc, vec, pos, uio);
@@ -825,7 +826,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
 		pos += vec->iov_len;
 	}
 	nfs_pageio_complete(&desc);
-	NFS_I(dreq->inode)->write_io += desc.pg_bytes_written;
 
 	/*
 	 * If no bytes were started, return the error, and let the
-- 
1.7.1.262.g5ef3d


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-09 14:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08  1:49 [PATCH 1/2] NFSv41: fix DIO write_io calculation Peng Tao
2012-08-08  1:49 ` [PATCH 2/2] NFS41: fix error of setting blocklayoutdriver Peng Tao
2012-08-08 12:49   ` Bryan Schumaker
2012-08-08 14:48     ` Peng Tao
2012-08-08 19:03 ` [PATCH 1/2] NFSv41: fix DIO write_io calculation Myklebust, Trond
2012-08-09  2:36   ` Peng Tao
2012-08-09 14:25     ` Myklebust, Trond
2012-08-09 14:31       ` Peng Tao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.