aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2018-02-21 15:27:28 -0500
committerJ. Bruce Fields <bfields@redhat.com>2018-03-20 17:51:13 -0400
commit86d29b10eb666f72da70bd5cf9c80b4446270c8c (patch)
tree31d6af62424fb6dc424a8ef3067a6e5c9267644d
parent0af6e690f0d4e8196f6cfa10bad5c9ffff565d9b (diff)
nfsd: move sc_file assignment into alloc_init_deleg
Take an easy chance to simplify the caller a little. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org>
-rw-r--r--fs/nfsd/nfs4state.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 5bbe86c6f1cb..fdcebfce5fdb 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -807,7 +807,8 @@ static void block_delegations(struct knfsd_fh *fh)
807} 807}
808 808
809static struct nfs4_delegation * 809static struct nfs4_delegation *
810alloc_init_deleg(struct nfs4_client *clp, struct svc_fh *current_fh, 810alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp,
811 struct svc_fh *current_fh,
811 struct nfs4_clnt_odstate *odstate) 812 struct nfs4_clnt_odstate *odstate)
812{ 813{
813 struct nfs4_delegation *dp; 814 struct nfs4_delegation *dp;
@@ -838,6 +839,8 @@ alloc_init_deleg(struct nfs4_client *clp, struct svc_fh *current_fh,
838 dp->dl_retries = 1; 839 dp->dl_retries = 1;
839 nfsd4_init_cb(&dp->dl_recall, dp->dl_stid.sc_client, 840 nfsd4_init_cb(&dp->dl_recall, dp->dl_stid.sc_client,
840 &nfsd4_cb_recall_ops, NFSPROC4_CLNT_CB_RECALL); 841 &nfsd4_cb_recall_ops, NFSPROC4_CLNT_CB_RECALL);
842 get_nfs4_file(fp);
843 dp->dl_stid.sc_file = fp;
841 return dp; 844 return dp;
842out_dec: 845out_dec:
843 atomic_long_dec(&num_delegations); 846 atomic_long_dec(&num_delegations);
@@ -4400,13 +4403,10 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
4400 if (status) 4403 if (status)
4401 return ERR_PTR(status); 4404 return ERR_PTR(status);
4402 4405
4403 dp = alloc_init_deleg(clp, fh, odstate); 4406 dp = alloc_init_deleg(clp, fp, fh, odstate);
4404 if (!dp) 4407 if (!dp)
4405 return ERR_PTR(-ENOMEM); 4408 return ERR_PTR(-ENOMEM);
4406 4409
4407 get_nfs4_file(fp);
4408 dp->dl_stid.sc_file = fp;
4409
4410 spin_lock(&state_lock); 4410 spin_lock(&state_lock);
4411 spin_lock(&fp->fi_lock); 4411 spin_lock(&fp->fi_lock);
4412 if (!fp->fi_deleg_file) { 4412 if (!fp->fi_deleg_file) {