aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs3proc.c16
-rw-r--r--fs/nfs/nfs3xdr.c6
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4xdr.c2
-rw-r--r--include/linux/nfs_xdr.h23
5 files changed, 22 insertions, 27 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 6dc4ef66f074..bb41d88e1567 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -448,7 +448,7 @@ nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name,
448 .new_dir = NFS_FH(new_dir), 448 .new_dir = NFS_FH(new_dir),
449 .new_name = new_name, 449 .new_name = new_name,
450 }; 450 };
451 struct nfs3_renameres res; 451 struct nfs_renameres res;
452 struct rpc_message msg = { 452 struct rpc_message msg = {
453 .rpc_proc = &nfs3_procedures[NFS3PROC_RENAME], 453 .rpc_proc = &nfs3_procedures[NFS3PROC_RENAME],
454 .rpc_argp = &arg, 454 .rpc_argp = &arg,
@@ -458,17 +458,17 @@ nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name,
458 458
459 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name); 459 dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name);
460 460
461 res.fromattr = nfs_alloc_fattr(); 461 res.old_fattr = nfs_alloc_fattr();
462 res.toattr = nfs_alloc_fattr(); 462 res.new_fattr = nfs_alloc_fattr();
463 if (res.fromattr == NULL || res.toattr == NULL) 463 if (res.old_fattr == NULL || res.new_fattr == NULL)
464 goto out; 464 goto out;
465 465
466 status = rpc_call_sync(NFS_CLIENT(old_dir), &msg, 0); 466 status = rpc_call_sync(NFS_CLIENT(old_dir), &msg, 0);
467 nfs_post_op_update_inode(old_dir, res.fromattr); 467 nfs_post_op_update_inode(old_dir, res.old_fattr);
468 nfs_post_op_update_inode(new_dir, res.toattr); 468 nfs_post_op_update_inode(new_dir, res.new_fattr);
469out: 469out:
470 nfs_free_fattr(res.toattr); 470 nfs_free_fattr(res.old_fattr);
471 nfs_free_fattr(res.fromattr); 471 nfs_free_fattr(res.new_fattr);
472 dprintk("NFS reply rename: %d\n", status); 472 dprintk("NFS reply rename: %d\n", status);
473 return status; 473 return status;
474} 474}
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index f385759eb35b..89c40f8ec6e6 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -970,14 +970,14 @@ nfs3_xdr_createres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res)
970 * Decode RENAME reply 970 * Decode RENAME reply
971 */ 971 */
972static int 972static int
973nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs3_renameres *res) 973nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs_renameres *res)
974{ 974{
975 int status; 975 int status;
976 976
977 if ((status = ntohl(*p++)) != 0) 977 if ((status = ntohl(*p++)) != 0)
978 status = nfs_stat_to_errno(status); 978 status = nfs_stat_to_errno(status);
979 p = xdr_decode_wcc_data(p, res->fromattr); 979 p = xdr_decode_wcc_data(p, res->old_fattr);
980 p = xdr_decode_wcc_data(p, res->toattr); 980 p = xdr_decode_wcc_data(p, res->new_fattr);
981 return status; 981 return status;
982} 982}
983 983
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 3aa13c1b8dd8..a3c21cc4677b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2577,7 +2577,7 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
2577 .new_name = new_name, 2577 .new_name = new_name,
2578 .bitmask = server->attr_bitmask, 2578 .bitmask = server->attr_bitmask,
2579 }; 2579 };
2580 struct nfs4_rename_res res = { 2580 struct nfs_renameres res = {
2581 .server = server, 2581 .server = server,
2582 }; 2582 };
2583 struct rpc_message msg = { 2583 struct rpc_message msg = {
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 7a098ae07a1b..b0bd7efe8100 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4873,7 +4873,7 @@ out:
4873/* 4873/*
4874 * Decode RENAME response 4874 * Decode RENAME response
4875 */ 4875 */
4876static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_rename_res *res) 4876static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs_renameres *res)
4877{ 4877{
4878 struct xdr_stream xdr; 4878 struct xdr_stream xdr;
4879 struct compound_hdr hdr; 4879 struct compound_hdr hdr;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index acb95fb27bcc..9ad132e13d12 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -411,6 +411,15 @@ struct nfs_renameargs {
411 struct nfs4_sequence_args seq_args; 411 struct nfs4_sequence_args seq_args;
412}; 412};
413 413
414struct nfs_renameres {
415 const struct nfs_server *server;
416 struct nfs4_change_info old_cinfo;
417 struct nfs_fattr *old_fattr;
418 struct nfs4_change_info new_cinfo;
419 struct nfs_fattr *new_fattr;
420 struct nfs4_sequence_res seq_res;
421};
422
414/* 423/*
415 * Argument struct for decode_entry function 424 * Argument struct for decode_entry function
416 */ 425 */
@@ -623,11 +632,6 @@ struct nfs3_readlinkargs {
623 struct page ** pages; 632 struct page ** pages;
624}; 633};
625 634
626struct nfs3_renameres {
627 struct nfs_fattr * fromattr;
628 struct nfs_fattr * toattr;
629};
630
631struct nfs3_linkres { 635struct nfs3_linkres {
632 struct nfs_fattr * dir_attr; 636 struct nfs_fattr * dir_attr;
633 struct nfs_fattr * fattr; 637 struct nfs_fattr * fattr;
@@ -795,15 +799,6 @@ struct nfs4_readlink_res {
795 struct nfs4_sequence_res seq_res; 799 struct nfs4_sequence_res seq_res;
796}; 800};
797 801
798struct nfs4_rename_res {
799 const struct nfs_server * server;
800 struct nfs4_change_info old_cinfo;
801 struct nfs_fattr * old_fattr;
802 struct nfs4_change_info new_cinfo;
803 struct nfs_fattr * new_fattr;
804 struct nfs4_sequence_res seq_res;
805};
806
807#define NFS4_SETCLIENTID_NAMELEN (127) 802#define NFS4_SETCLIENTID_NAMELEN (127)
808struct nfs4_setclientid { 803struct nfs4_setclientid {
809 const nfs4_verifier * sc_verifier; 804 const nfs4_verifier * sc_verifier;