From patchwork Fri Sep 21 01:35:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 1488691 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 67EEFDFFD0 for ; Fri, 21 Sep 2012 01:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581Ab2IUBgd (ORCPT ); Thu, 20 Sep 2012 21:36:33 -0400 Received: from mx2.netapp.com ([216.240.18.37]:26053 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517Ab2IUBgF (ORCPT ); Thu, 20 Sep 2012 21:36:05 -0400 X-IronPort-AV: E=Sophos;i="4.80,458,1344236400"; d="scan'208";a="692166511" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 20 Sep 2012 18:36:05 -0700 Received: from lade.trondhjem.org.com (lade.trondhjem.org [10.63.233.1] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q8L1a0c4022580; Thu, 20 Sep 2012 18:36:05 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 06/14] NFSv4.1: reset the inode MDS threshold counters on layout destruction Date: Thu, 20 Sep 2012 21:35:49 -0400 Message-Id: <1348191357-44503-6-git-send-email-Trond.Myklebust@netapp.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348191357-44503-5-git-send-email-Trond.Myklebust@netapp.com> References: <1348191357-44503-1-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-2-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-3-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-4-git-send-email-Trond.Myklebust@netapp.com> <1348191357-44503-5-git-send-email-Trond.Myklebust@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Instead of resetting the inode MDS threshold counters when we mark the layout for destruction, do it as part of freeing the layout. Signed-off-by: Trond Myklebust --- fs/nfs/pnfs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index f3acb68..8633b78 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -215,9 +215,13 @@ pnfs_free_layout_hdr(struct pnfs_layout_hdr *lo) static void destroy_layout_hdr(struct pnfs_layout_hdr *lo) { + struct nfs_inode *nfsi = NFS_I(lo->plh_inode); dprintk("%s: freeing layout cache %p\n", __func__, lo); BUG_ON(!list_empty(&lo->plh_layouts)); - NFS_I(lo->plh_inode)->layout = NULL; + nfsi->layout = NULL; + /* Reset MDS Threshold I/O counters */ + nfsi->write_io = 0; + nfsi->read_io = 0; pnfs_free_layout_hdr(lo); } @@ -436,9 +440,6 @@ pnfs_mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo, dprintk("%s:Begin lo %p\n", __func__, lo); if (list_empty(&lo->plh_segs)) { - /* Reset MDS Threshold I/O counters */ - NFS_I(lo->plh_inode)->write_io = 0; - NFS_I(lo->plh_inode)->read_io = 0; if (!test_and_set_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags)) pnfs_put_layout_hdr_locked(lo); return 0;