Commit 7ebe40f2 authored by Benny Halevy's avatar Benny Halevy Committed by J. Bruce Fields

nfsd: remove_stid can be incorporated into nfs4_put_delegation

All calls to nfs4_put_delegation are preceded with remove_stid.
Signed-off-by: default avatarBenny Halevy <bhalevy@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 5d7dab83
...@@ -410,6 +410,7 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s) ...@@ -410,6 +410,7 @@ static void nfs4_free_stid(struct kmem_cache *slab, struct nfs4_stid *s)
void void
nfs4_put_delegation(struct nfs4_delegation *dp) nfs4_put_delegation(struct nfs4_delegation *dp)
{ {
remove_stid(&dp->dl_stid);
if (atomic_dec_and_test(&dp->dl_count)) { if (atomic_dec_and_test(&dp->dl_count)) {
nfs4_free_stid(deleg_slab, &dp->dl_stid); nfs4_free_stid(deleg_slab, &dp->dl_stid);
num_delegations--; num_delegations--;
...@@ -450,14 +451,12 @@ unhash_delegation(struct nfs4_delegation *dp) ...@@ -450,14 +451,12 @@ unhash_delegation(struct nfs4_delegation *dp)
static void destroy_revoked_delegation(struct nfs4_delegation *dp) static void destroy_revoked_delegation(struct nfs4_delegation *dp)
{ {
list_del_init(&dp->dl_recall_lru); list_del_init(&dp->dl_recall_lru);
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp); nfs4_put_delegation(dp);
} }
static void destroy_delegation(struct nfs4_delegation *dp) static void destroy_delegation(struct nfs4_delegation *dp)
{ {
unhash_delegation(dp); unhash_delegation(dp);
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp); nfs4_put_delegation(dp);
} }
...@@ -3159,7 +3158,6 @@ nfs4_open_delegation(struct net *net, struct svc_fh *fh, ...@@ -3159,7 +3158,6 @@ nfs4_open_delegation(struct net *net, struct svc_fh *fh,
open->op_delegate_type = NFS4_OPEN_DELEGATE_READ; open->op_delegate_type = NFS4_OPEN_DELEGATE_READ;
return; return;
out_free: out_free:
remove_stid(&dp->dl_stid);
nfs4_put_delegation(dp); nfs4_put_delegation(dp);
out_no_deleg: out_no_deleg:
open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE; open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment