Skip to content

Commit

Permalink
nfsd: no need to unhash_stid before free
Browse files Browse the repository at this point in the history
idr_remove is about to be called before kmem_cache_free so unhashing it
is redundant

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 29, 2013
1 parent 7ebe40f commit 01a87d9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ static void unhash_open_stateid(struct nfs4_ol_stateid *stp)
static void release_open_stateid(struct nfs4_ol_stateid *stp)
{
unhash_open_stateid(stp);
unhash_stid(&stp->st_stid);
free_generic_stateid(stp);
}

Expand All @@ -694,7 +693,6 @@ static void release_last_closed_stateid(struct nfs4_openowner *oo)
struct nfs4_ol_stateid *s = oo->oo_last_closed_stid;

if (s) {
unhash_stid(&s->st_stid);
free_generic_stateid(s);
oo->oo_last_closed_stid = NULL;
}
Expand Down Expand Up @@ -3998,10 +3996,9 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,

nfsd4_close_open_stateid(stp);

if (cstate->minorversion) {
unhash_stid(&stp->st_stid);
if (cstate->minorversion)
free_generic_stateid(stp);
} else
else
oo->oo_last_closed_stid = stp;

if (list_empty(&oo->oo_owner.so_stateids)) {
Expand Down

0 comments on commit 01a87d9

Please sign in to comment.