Skip to content

Commit 478ed7b

Browse files
committed
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 <[email protected]>
1 parent 24d796e commit 478ed7b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,13 +1724,6 @@ static __be32 nfsd4_do_copy(struct nfsd4_copy *copy, bool sync)
17241724
nfsd4_init_copy_res(copy, sync);
17251725
status = nfs_ok;
17261726
}
1727-
1728-
if (nfsd4_ssc_is_inter(copy))
1729-
nfsd4_cleanup_inter_ssc(copy->ss_mnt, copy->nf_src->nf_file,
1730-
copy->nf_dst);
1731-
else
1732-
nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
1733-
17341727
return status;
17351728
}
17361729

@@ -1786,9 +1779,14 @@ static int nfsd4_do_async_copy(void *data)
17861779
nfsd4_interssc_disconnect(copy->ss_mnt);
17871780
goto do_callback;
17881781
}
1782+
copy->nfserr = nfsd4_do_copy(copy, 0);
1783+
nfsd4_cleanup_inter_ssc(copy->ss_mnt, copy->nf_src->nf_file,
1784+
copy->nf_dst);
1785+
} else {
1786+
copy->nfserr = nfsd4_do_copy(copy, 0);
1787+
nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
17891788
}
17901789

1791-
copy->nfserr = nfsd4_do_copy(copy, 0);
17921790
do_callback:
17931791
cb_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL);
17941792
if (!cb_copy)
@@ -1864,6 +1862,7 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
18641862
status = nfs_ok;
18651863
} else {
18661864
status = nfsd4_do_copy(copy, 1);
1865+
nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
18671866
}
18681867
out:
18691868
return status;

0 commit comments

Comments
 (0)