summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2022-07-27 14:40:53 -0400
committerChuck Lever <chuck.lever@oracle.com>2022-07-29 20:16:59 -0400
commit478ed7b10d875da2743d1a22822b9f8a82df8f12 (patch)
tree16b24c2ddd6cf7793ee38630a6755d5d944bb372 /fs/nfsd
parent24d796ea383b8a4c8234e06d1b14bbcd371192ea (diff)
downloadlwn-478ed7b10d875da2743d1a22822b9f8a82df8f12.tar.gz
lwn-478ed7b10d875da2743d1a22822b9f8a82df8f12.zip
NFSD: Refactor nfsd4_cleanup_inter_ssc() (2/2)
Move the nfsd4_cleanup_*() call sites out of nfsd4_do_copy(). A subsequent patch will modify one of the new call sites to avoid the need to manufacture the phony struct nfsd_file. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index cb9274f24c7d..8f85365435df 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1724,13 +1724,6 @@ static __be32 nfsd4_do_copy(struct nfsd4_copy *copy, bool sync)
nfsd4_init_copy_res(copy, sync);
status = nfs_ok;
}
-
- if (nfsd4_ssc_is_inter(copy))
- nfsd4_cleanup_inter_ssc(copy->ss_mnt, copy->nf_src->nf_file,
- copy->nf_dst);
- else
- nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
-
return status;
}
@@ -1786,9 +1779,14 @@ static int nfsd4_do_async_copy(void *data)
nfsd4_interssc_disconnect(copy->ss_mnt);
goto do_callback;
}
+ copy->nfserr = nfsd4_do_copy(copy, 0);
+ nfsd4_cleanup_inter_ssc(copy->ss_mnt, copy->nf_src->nf_file,
+ copy->nf_dst);
+ } else {
+ copy->nfserr = nfsd4_do_copy(copy, 0);
+ nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
}
- copy->nfserr = nfsd4_do_copy(copy, 0);
do_callback:
cb_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL);
if (!cb_copy)
@@ -1864,6 +1862,7 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfs_ok;
} else {
status = nfsd4_do_copy(copy, 1);
+ nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
}
out:
return status;