summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust2012-09-20 21:52:13 +0200
committerTrond Myklebust2012-09-28 22:03:12 +0200
commitbb346f63976823c2959b0c5917928f12cbf96e4a (patch)
treeff9fdcdc22165d111469e2ebeb395a1d5c47d4a5 /fs/nfs/pnfs.c
parentNFSv4.1: Get rid of pNFS layout state "NFS_LAYOUT_INVALID" (diff)
downloadkernel-qcow2-linux-bb346f63976823c2959b0c5917928f12cbf96e4a.tar.gz
kernel-qcow2-linux-bb346f63976823c2959b0c5917928f12cbf96e4a.tar.xz
kernel-qcow2-linux-bb346f63976823c2959b0c5917928f12cbf96e4a.zip
NFSv4.1: reset the inode MDS threshold counters on layout destruction
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 <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 8b32f8745337..ac94fb86fd19 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);
}
@@ -461,9 +465,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;