Skip to content

Commit

Permalink
nfsd: nfs4_free_stid
Browse files Browse the repository at this point in the history
Make it symmetric to nfs4_alloc_stid.

Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed Oct 28, 2013
1 parent cce6de9 commit 9857df8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,16 @@ static void remove_stid(struct nfs4_stid *s)
idr_remove(stateids, s->sc_stateid.si_opaque.so_id);
}

static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
{
kmem_cache_free(slab, s);
}

void
nfs4_put_delegation(struct nfs4_delegation *dp)
{
if (atomic_dec_and_test(&dp->dl_count)) {
kmem_cache_free(deleg_slab, dp);
nfs4_free_stid(deleg_slab, &dp->dl_stid);
num_delegations--;
}
}
Expand Down Expand Up @@ -610,7 +615,7 @@ static void close_generic_stateid(struct nfs4_ol_stateid *stp)
static void free_generic_stateid(struct nfs4_ol_stateid *stp)
{
remove_stid(&stp->st_stid);
kmem_cache_free(stateid_slab, stp);
nfs4_free_stid(stateid_slab, &stp->st_stid);
}

static void release_lock_stateid(struct nfs4_ol_stateid *stp)
Expand Down

0 comments on commit 9857df8

Please sign in to comment.