Skip to content

Commit

Permalink
nfsd: remove_stid can be incorporated into nfs4_put_delegation
Browse files Browse the repository at this point in the history
All calls to nfs4_put_delegation are preceded with remove_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 5d7dab8 commit 7ebe40f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
void
nfs4_put_delegation(struct nfs4_delegation *dp)
{
remove_stid(&dp->dl_stid);
if (atomic_dec_and_test(&dp->dl_count)) {
nfs4_free_stid(deleg_slab, &dp->dl_stid);
num_delegations--;
Expand Down Expand Up @@ -450,14 +451,12 @@ unhash_delegation(struct nfs4_delegation *dp)
static void destroy_revoked_delegation(struct nfs4_delegation *dp)
{
list_del_init(&dp->dl_recall_lru);
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp);
}

static void destroy_delegation(struct nfs4_delegation *dp)
{
unhash_delegation(dp);
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp);
}

Expand Down Expand Up @@ -3159,7 +3158,6 @@ nfs4_open_delegation(struct net *net, struct svc_fh *fh,
open->op_delegate_type = NFS4_OPEN_DELEGATE_READ;
return;
out_free:
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp);
out_no_deleg:
open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE;
Expand Down

0 comments on commit 7ebe40f

Please sign in to comment.