aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@primarydata.com>2013-10-14 06:44:52 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-10-28 15:43:06 -0400
commit9857df815f17417be116f800636f460e247afb5a (patch)
treed449f3f385d444743de4b3980ea133a997defa72 /fs
parentcce6de908ee934fbea12d6cccc55b87dbd4b0c8a (diff)
nfsd: nfs4_free_stid
Make it symmetric to nfs4_alloc_stid. Signed-off-by: Benny Halevy <bhalevy@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a601fd49f997..9cb1b17014f5 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s)
402 idr_remove(stateids, s->sc_stateid.si_opaque.so_id); 402 idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
403} 403}
404 404
405static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
406{
407 kmem_cache_free(slab, s);
408}
409
405void 410void
406nfs4_put_delegation(struct nfs4_delegation *dp) 411nfs4_put_delegation(struct nfs4_delegation *dp)
407{ 412{
408 if (atomic_dec_and_test(&dp->dl_count)) { 413 if (atomic_dec_and_test(&dp->dl_count)) {
409 kmem_cache_free(deleg_slab, dp); 414 nfs4_free_stid(deleg_slab, &dp->dl_stid);
410 num_delegations--; 415 num_delegations--;
411 } 416 }
412} 417}
@@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)
610static void free_generic_stateid(struct nfs4_ol_stateid *stp) 615static void free_generic_stateid(struct nfs4_ol_stateid *stp)
611{ 616{
612 remove_stid(&stp->st_stid); 617 remove_stid(&stp->st_stid);
613 kmem_cache_free(stateid_slab, stp); 618 nfs4_free_stid(stateid_slab, &stp->st_stid);
614} 619}
615 620
616static void release_lock_stateid(struct nfs4_ol_stateid *stp) 621static void release_lock_stateid(struct nfs4_ol_stateid *stp)