NFSD: Refactor nfsd4_cleanup_inter_ssc() (2/2)
[ Upstream commit 478ed7b10d875da2743d1a22822b9f8a82df8f12 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
0d592d96d6
commit
8153ed38cc
@@ -1714,13 +1714,6 @@ static __be32 nfsd4_do_copy(struct nfsd4_copy *copy, bool sync)
|
|||||||
nfsd4_init_copy_res(copy, sync);
|
nfsd4_init_copy_res(copy, sync);
|
||||||
status = nfs_ok;
|
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;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1776,9 +1769,14 @@ static int nfsd4_do_async_copy(void *data)
|
|||||||
/* ss_mnt will be unmounted by the laundromat */
|
/* ss_mnt will be unmounted by the laundromat */
|
||||||
goto do_callback;
|
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:
|
do_callback:
|
||||||
cb_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL);
|
cb_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL);
|
||||||
if (!cb_copy)
|
if (!cb_copy)
|
||||||
@@ -1854,6 +1852,7 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
|||||||
status = nfs_ok;
|
status = nfs_ok;
|
||||||
} else {
|
} else {
|
||||||
status = nfsd4_do_copy(copy, 1);
|
status = nfsd4_do_copy(copy, 1);
|
||||||
|
nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
return status;
|
return status;
|
||||||
|
Reference in New Issue
Block a user