NFS: add ca_source_server<> to COPY
Support only one source server address: the same address that the client and source server use. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
This commit is contained in:

committed by
Olga Kornievskaia

parent
0491567b51
commit
1d38f3f0d7
@@ -243,7 +243,9 @@ static ssize_t _nfs42_proc_copy(struct file *src,
|
||||
struct file *dst,
|
||||
struct nfs_lock_context *dst_lock,
|
||||
struct nfs42_copy_args *args,
|
||||
struct nfs42_copy_res *res)
|
||||
struct nfs42_copy_res *res,
|
||||
struct nl4_server *nss,
|
||||
nfs4_stateid *cnr_stateid)
|
||||
{
|
||||
struct rpc_message msg = {
|
||||
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COPY],
|
||||
@@ -257,11 +259,15 @@ static ssize_t _nfs42_proc_copy(struct file *src,
|
||||
size_t count = args->count;
|
||||
ssize_t status;
|
||||
|
||||
status = nfs4_set_rw_stateid(&args->src_stateid, src_lock->open_context,
|
||||
src_lock, FMODE_READ);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (nss) {
|
||||
args->cp_src = nss;
|
||||
nfs4_stateid_copy(&args->src_stateid, cnr_stateid);
|
||||
} else {
|
||||
status = nfs4_set_rw_stateid(&args->src_stateid,
|
||||
src_lock->open_context, src_lock, FMODE_READ);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
status = nfs_filemap_write_and_wait_range(file_inode(src)->i_mapping,
|
||||
pos_src, pos_src + (loff_t)count - 1);
|
||||
if (status)
|
||||
@@ -325,8 +331,9 @@ out:
|
||||
}
|
||||
|
||||
ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
|
||||
struct file *dst, loff_t pos_dst,
|
||||
size_t count)
|
||||
struct file *dst, loff_t pos_dst, size_t count,
|
||||
struct nl4_server *nss,
|
||||
nfs4_stateid *cnr_stateid)
|
||||
{
|
||||
struct nfs_server *server = NFS_SERVER(file_inode(dst));
|
||||
struct nfs_lock_context *src_lock;
|
||||
@@ -368,7 +375,8 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
|
||||
inode_lock(file_inode(dst));
|
||||
err = _nfs42_proc_copy(src, src_lock,
|
||||
dst, dst_lock,
|
||||
&args, &res);
|
||||
&args, &res,
|
||||
nss, cnr_stateid);
|
||||
inode_unlock(file_inode(dst));
|
||||
|
||||
if (err >= 0)
|
||||
|
Reference in New Issue
Block a user