summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-06 20:50:49 +0200
committerJ. Bruce Fields <bfields@redhat.com>2011-09-07 15:47:23 +0200
commit4665e2bac5076d02264f4a4d79edafa05ec7b752 (patch)
treed0bf0461e1412fe303da611a9eacad5272f84da0
parentnfsd4: split stateowners into open and lockowners (diff)
downloadlinux-4665e2bac5076d02264f4a4d79edafa05ec7b752.tar.xz
linux-4665e2bac5076d02264f4a4d79edafa05ec7b752.zip
nfsd4: split out some free_generic_stateid code
We'll use this elsewhere. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 567130dccda0..c28432a80210 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -411,7 +411,7 @@ static void unhash_generic_stateid(struct nfs4_stateid *stp)
list_del(&stp->st_perstateowner);
}
-static void free_generic_stateid(struct nfs4_stateid *stp)
+static void close_generic_stateid(struct nfs4_stateid *stp)
{
int i;
@@ -420,9 +420,16 @@ static void free_generic_stateid(struct nfs4_stateid *stp)
if (test_bit(i, &stp->st_access_bmap))
nfs4_file_put_access(stp->st_file,
nfs4_access_to_omode(i));
+ __clear_bit(i, &stp->st_access_bmap);
}
}
put_nfs4_file(stp->st_file);
+ stp->st_file = NULL;
+}
+
+static void free_generic_stateid(struct nfs4_stateid *stp)
+{
+ close_generic_stateid(stp);
kmem_cache_free(stateid_slab, stp);
}