@@ -1763,6 +1763,27 @@ static void cleanup_async_copy(struct nfsd4_copy *copy)
1763
1763
nfs4_put_copy (copy );
1764
1764
}
1765
1765
1766
+ static void nfsd4_send_cb_offload (struct nfsd4_copy * copy )
1767
+ {
1768
+ struct nfsd4_copy * cb_copy ;
1769
+
1770
+ cb_copy = kzalloc (sizeof (struct nfsd4_copy ), GFP_KERNEL );
1771
+ if (!cb_copy )
1772
+ return ;
1773
+
1774
+ refcount_set (& cb_copy -> refcount , 1 );
1775
+ memcpy (& cb_copy -> cp_res , & copy -> cp_res , sizeof (copy -> cp_res ));
1776
+ cb_copy -> cp_clp = copy -> cp_clp ;
1777
+ cb_copy -> nfserr = copy -> nfserr ;
1778
+ memcpy (& cb_copy -> fh , & copy -> fh , sizeof (copy -> fh ));
1779
+
1780
+ nfsd4_init_cb (& cb_copy -> cp_cb , cb_copy -> cp_clp ,
1781
+ & nfsd4_cb_offload_ops , NFSPROC4_CLNT_CB_OFFLOAD );
1782
+ trace_nfsd_cb_offload (copy -> cp_clp , & copy -> cp_res .cb_stateid ,
1783
+ & copy -> fh , copy -> cp_count , copy -> nfserr );
1784
+ nfsd4_run_cb (& cb_copy -> cp_cb );
1785
+ }
1786
+
1766
1787
/**
1767
1788
* nfsd4_do_async_copy - kthread function for background server-side COPY
1768
1789
* @data: arguments for COPY operation
@@ -1773,7 +1794,6 @@ static void cleanup_async_copy(struct nfsd4_copy *copy)
1773
1794
static int nfsd4_do_async_copy (void * data )
1774
1795
{
1775
1796
struct nfsd4_copy * copy = (struct nfsd4_copy * )data ;
1776
- struct nfsd4_copy * cb_copy ;
1777
1797
1778
1798
if (nfsd4_ssc_is_inter (copy )) {
1779
1799
struct file * filp ;
@@ -1795,20 +1815,7 @@ static int nfsd4_do_async_copy(void *data)
1795
1815
}
1796
1816
1797
1817
do_callback :
1798
- cb_copy = kzalloc (sizeof (struct nfsd4_copy ), GFP_KERNEL );
1799
- if (!cb_copy )
1800
- goto out ;
1801
- refcount_set (& cb_copy -> refcount , 1 );
1802
- memcpy (& cb_copy -> cp_res , & copy -> cp_res , sizeof (copy -> cp_res ));
1803
- cb_copy -> cp_clp = copy -> cp_clp ;
1804
- cb_copy -> nfserr = copy -> nfserr ;
1805
- memcpy (& cb_copy -> fh , & copy -> fh , sizeof (copy -> fh ));
1806
- nfsd4_init_cb (& cb_copy -> cp_cb , cb_copy -> cp_clp ,
1807
- & nfsd4_cb_offload_ops , NFSPROC4_CLNT_CB_OFFLOAD );
1808
- trace_nfsd_cb_offload (copy -> cp_clp , & copy -> cp_res .cb_stateid ,
1809
- & copy -> fh , copy -> cp_count , copy -> nfserr );
1810
- nfsd4_run_cb (& cb_copy -> cp_cb );
1811
- out :
1818
+ nfsd4_send_cb_offload (copy );
1812
1819
cleanup_async_copy (copy );
1813
1820
return 0 ;
1814
1821
}
0 commit comments