@@ -1670,10 +1670,10 @@ static void nfsd4_init_copy_res(struct nfsd4_copy *copy, bool sync)
1670
1670
gen_boot_verifier (& copy -> cp_res .wr_verifier , copy -> cp_clp -> net );
1671
1671
}
1672
1672
1673
- static ssize_t _nfsd_copy_file_range (struct nfsd4_copy * copy )
1673
+ static ssize_t _nfsd_copy_file_range (struct nfsd4_copy * copy ,
1674
+ struct file * dst ,
1675
+ struct file * src )
1674
1676
{
1675
- struct file * dst = copy -> nf_dst -> nf_file ;
1676
- struct file * src = copy -> nf_src -> nf_file ;
1677
1677
errseq_t since ;
1678
1678
ssize_t bytes_copied = 0 ;
1679
1679
u64 bytes_total = copy -> cp_count ;
@@ -1709,12 +1709,15 @@ static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy)
1709
1709
return bytes_copied ;
1710
1710
}
1711
1711
1712
- static __be32 nfsd4_do_copy (struct nfsd4_copy * copy , bool sync )
1712
+ static __be32 nfsd4_do_copy (struct nfsd4_copy * copy ,
1713
+ struct file * src , struct file * dst ,
1714
+ bool sync )
1713
1715
{
1714
1716
__be32 status ;
1715
1717
ssize_t bytes ;
1716
1718
1717
- bytes = _nfsd_copy_file_range (copy );
1719
+ bytes = _nfsd_copy_file_range (copy , dst , src );
1720
+
1718
1721
/* for async copy, we ignore the error, client can always retry
1719
1722
* to get the error
1720
1723
*/
@@ -1779,11 +1782,13 @@ static int nfsd4_do_async_copy(void *data)
1779
1782
nfsd4_interssc_disconnect (copy -> ss_mnt );
1780
1783
goto do_callback ;
1781
1784
}
1782
- copy -> nfserr = nfsd4_do_copy (copy , 0 );
1785
+ copy -> nfserr = nfsd4_do_copy (copy , copy -> nf_src -> nf_file ,
1786
+ copy -> nf_dst -> nf_file , false);
1783
1787
nfsd4_cleanup_inter_ssc (copy -> ss_mnt , copy -> nf_src -> nf_file ,
1784
1788
copy -> nf_dst );
1785
1789
} else {
1786
- copy -> nfserr = nfsd4_do_copy (copy , 0 );
1790
+ copy -> nfserr = nfsd4_do_copy (copy , copy -> nf_src -> nf_file ,
1791
+ copy -> nf_dst -> nf_file , false);
1787
1792
nfsd4_cleanup_intra_ssc (copy -> nf_src , copy -> nf_dst );
1788
1793
}
1789
1794
@@ -1861,7 +1866,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1861
1866
wake_up_process (async_copy -> copy_task );
1862
1867
status = nfs_ok ;
1863
1868
} else {
1864
- status = nfsd4_do_copy (copy , 1 );
1869
+ status = nfsd4_do_copy (copy , copy -> nf_src -> nf_file ,
1870
+ copy -> nf_dst -> nf_file , true);
1865
1871
nfsd4_cleanup_intra_ssc (copy -> nf_src , copy -> nf_dst );
1866
1872
}
1867
1873
out :
0 commit comments