@@ -1763,29 +1763,31 @@ static void cleanup_async_copy(struct nfsd4_copy *copy)
1763
1763
nfs4_put_copy (copy );
1764
1764
}
1765
1765
1766
+ /**
1767
+ * nfsd4_do_async_copy - kthread function for background server-side COPY
1768
+ * @data: arguments for COPY operation
1769
+ *
1770
+ * Return values:
1771
+ * %0: Copy operation is done.
1772
+ */
1766
1773
static int nfsd4_do_async_copy (void * data )
1767
1774
{
1768
1775
struct nfsd4_copy * copy = (struct nfsd4_copy * )data ;
1769
1776
struct nfsd4_copy * cb_copy ;
1770
1777
1771
1778
if (nfsd4_ssc_is_inter (copy )) {
1772
- copy -> nf_src = kzalloc (sizeof (struct nfsd_file ), GFP_KERNEL );
1773
- if (!copy -> nf_src ) {
1774
- copy -> nfserr = nfserr_serverfault ;
1775
- nfsd4_interssc_disconnect (copy -> ss_mnt );
1776
- goto do_callback ;
1777
- }
1778
- copy -> nf_src -> nf_file = nfs42_ssc_open (copy -> ss_mnt , & copy -> c_fh ,
1779
- & copy -> stateid );
1780
- if (IS_ERR (copy -> nf_src -> nf_file )) {
1779
+ struct file * filp ;
1780
+
1781
+ filp = nfs42_ssc_open (copy -> ss_mnt , & copy -> c_fh ,
1782
+ & copy -> stateid );
1783
+ if (IS_ERR (filp )) {
1781
1784
copy -> nfserr = nfserr_offload_denied ;
1782
1785
nfsd4_interssc_disconnect (copy -> ss_mnt );
1783
1786
goto do_callback ;
1784
1787
}
1785
- copy -> nfserr = nfsd4_do_copy (copy , copy -> nf_src -> nf_file ,
1788
+ copy -> nfserr = nfsd4_do_copy (copy , filp ,
1786
1789
copy -> nf_dst -> nf_file , false);
1787
- nfsd4_cleanup_inter_ssc (copy -> ss_mnt , copy -> nf_src -> nf_file ,
1788
- copy -> nf_dst );
1790
+ nfsd4_cleanup_inter_ssc (copy -> ss_mnt , filp , copy -> nf_dst );
1789
1791
} else {
1790
1792
copy -> nfserr = nfsd4_do_copy (copy , copy -> nf_src -> nf_file ,
1791
1793
copy -> nf_dst -> nf_file , false);
@@ -1807,8 +1809,6 @@ static int nfsd4_do_async_copy(void *data)
1807
1809
& copy -> fh , copy -> cp_count , copy -> nfserr );
1808
1810
nfsd4_run_cb (& cb_copy -> cp_cb );
1809
1811
out :
1810
- if (nfsd4_ssc_is_inter (copy ))
1811
- kfree (copy -> nf_src );
1812
1812
cleanup_async_copy (copy );
1813
1813
return 0 ;
1814
1814
}
0 commit comments