public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Peng Tao <tao.peng@primarydata.com>
To: linux-nfs <linux-nfs@vger.kernel.org>
Cc: Peng Tao <tao.peng@primarydata.com>
Subject: [PATCH 09/11] pnfs/flexfiles: reset IO statistics upon LAYOUTSTATS success
Date: Tue, 16 Jun 2015 22:47:30 +0800	[thread overview]
Message-ID: <1434466052-10491-10-git-send-email-tao.peng@primarydata.com> (raw)
In-Reply-To: <1434466052-10491-1-git-send-email-tao.peng@primarydata.com>

Per RFC NFSv42 draft, client MUST reset the statistics after getting
a successfully reply from the metadata server.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
---
 fs/nfs/flexfilelayout/flexfilelayout.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 64beedd..4b79c74 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1881,6 +1881,14 @@ ff_layout_cleanup_layoutstats(struct nfs42_layoutstat_data *data)
 	for (i = 0; i < data->args.num_dev; i++) {
 		mirror = data->args.devinfo[i].layout_private;
 		data->args.devinfo[i].layout_private = NULL;
+		if (data->res.rpc_status == NFS4_OK) {
+			spin_lock(&mirror->lock);
+			memset(&mirror->read_stat.io_stat, 0,
+				sizeof(mirror->read_stat.io_stat));
+			memset(&mirror->write_stat.io_stat, 0,
+				sizeof(mirror->write_stat.io_stat));
+			spin_unlock(&mirror->lock);
+		}
 		pnfs_put_lseg(mirror->lseg);
 	}
 }
-- 
1.8.3.1


  parent reply	other threads:[~2015-06-16 14:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 14:47 [PATCH 00/11] pnfs/flexfiles: layoutstats support Peng Tao
2015-06-16 14:47 ` [PATCH 01/11] NFSv.2/pnfs Add a LAYOUTSTATS rpc function Peng Tao
2015-06-18 20:14   ` Jeff Layton
2015-06-16 14:47 ` [PATCH 02/11] pNFS: fill in nfs42_layoutstat_ops Peng Tao
2015-06-16 14:47 ` [PATCH 03/11] pnfs: add pnfs_report_layoutstat helper function Peng Tao
2015-06-16 14:47 ` [PATCH 04/11] pNFS/flexfiles: Remove unused struct members user_name, group_name Peng Tao
2015-06-16 14:47 ` [PATCH 05/11] pNFS/flexfiles: add layoutstats tracking Peng Tao
2015-06-16 14:47 ` [PATCH 06/11] pNFS/flexfiles: track when layout is first used Peng Tao
2015-06-18 16:30   ` Jeff Layton
2015-06-16 14:47 ` [PATCH 07/11] pnfs/flexfiles: add ff_layout_prepare_layoutstats Peng Tao
2015-06-16 14:47 ` [PATCH 08/11] pnfs/flexfiles: encode LAYOUTSTATS flexfiles specific data Peng Tao
2015-06-16 14:47 ` Peng Tao [this message]
2015-06-16 14:47 ` [PATCH 10/11] nfs42: serialize LAYOUTSTATS calls of the same file Peng Tao
2015-06-16 14:47 ` [PATCH 11/11] pnfs/flexfiles: report layoutstat regularly Peng Tao
2015-06-18 20:17 ` [PATCH 00/11] pnfs/flexfiles: layoutstats support Jeff Layton
2015-06-19  1:47   ` Peng Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434466052-10491-10-git-send-email-tao.peng@primarydata.com \
    --to=tao.peng@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox