aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs2xdr.c8
-rw-r--r--fs/nfs/nfs3proc.c12
-rw-r--r--fs/nfs/nfs3xdr.c10
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4xdr.c2
-rw-r--r--fs/nfs/proc.c10
-rw-r--r--include/linux/nfs_xdr.h39
7 files changed, 32 insertions, 51 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index db8846a0e82e..e15bc0306d0c 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -337,10 +337,10 @@ nfs_xdr_createargs(struct rpc_rqst *req, __be32 *p, struct nfs_createargs *args)
337static int 337static int
338nfs_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs_renameargs *args) 338nfs_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs_renameargs *args)
339{ 339{
340 p = xdr_encode_fhandle(p, args->fromfh); 340 p = xdr_encode_fhandle(p, args->old_dir);
341 p = xdr_encode_array(p, args->fromname, args->fromlen); 341 p = xdr_encode_array(p, args->old_name->name, args->old_name->len);
342 p = xdr_encode_fhandle(p, args->tofh); 342 p = xdr_encode_fhandle(p, args->new_dir);
343 p = xdr_encode_array(p, args->toname, args->tolen); 343 p = xdr_encode_array(p, args->new_name->name, args->new_name->len);
344 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 344 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
345 return 0; 345 return 0;
346} 346}
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 2be4a7f59f1c..6dc4ef66f074 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -442,13 +442,11 @@ static int
442nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name, 442nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name,
443 struct inode *new_dir, struct qstr *new_name) 443 struct inode *new_dir, struct qstr *new_name)
444{ 444{
445 struct nfs3_renameargs arg = { 445 struct nfs_renameargs arg = {
446 .fromfh = NFS_FH(old_dir), 446 .old_dir = NFS_FH(old_dir),
447 .fromname = old_name->name, 447 .old_name = old_name,
448 .fromlen = old_name->len, 448 .new_dir = NFS_FH(new_dir),
449 .tofh = NFS_FH(new_dir), 449 .new_name = new_name,
450 .toname = new_name->name,
451 .tolen = new_name->len
452 }; 450 };
453 struct nfs3_renameres res; 451 struct nfs3_renameres res;
454 struct rpc_message msg = { 452 struct rpc_message msg = {
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 9769704f8ce6..f385759eb35b 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -442,12 +442,12 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, __be32 *p, struct nfs3_mknodargs *args)
442 * Encode RENAME arguments 442 * Encode RENAME arguments
443 */ 443 */
444static int 444static int
445nfs3_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs3_renameargs *args) 445nfs3_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs_renameargs *args)
446{ 446{
447 p = xdr_encode_fhandle(p, args->fromfh); 447 p = xdr_encode_fhandle(p, args->old_dir);
448 p = xdr_encode_array(p, args->fromname, args->fromlen); 448 p = xdr_encode_array(p, args->old_name->name, args->old_name->len);
449 p = xdr_encode_fhandle(p, args->tofh); 449 p = xdr_encode_fhandle(p, args->new_dir);
450 p = xdr_encode_array(p, args->toname, args->tolen); 450 p = xdr_encode_array(p, args->new_name->name, args->new_name->len);
451 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 451 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
452 return 0; 452 return 0;
453} 453}
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 643abd26f2de..3aa13c1b8dd8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2570,7 +2570,7 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
2570 struct inode *new_dir, struct qstr *new_name) 2570 struct inode *new_dir, struct qstr *new_name)
2571{ 2571{
2572 struct nfs_server *server = NFS_SERVER(old_dir); 2572 struct nfs_server *server = NFS_SERVER(old_dir);
2573 struct nfs4_rename_arg arg = { 2573 struct nfs_renameargs arg = {
2574 .old_dir = NFS_FH(old_dir), 2574 .old_dir = NFS_FH(old_dir),
2575 .new_dir = NFS_FH(new_dir), 2575 .new_dir = NFS_FH(new_dir),
2576 .old_name = old_name, 2576 .old_name = old_name,
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 08ef91291132..7a098ae07a1b 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1823,7 +1823,7 @@ static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs
1823/* 1823/*
1824 * Encode RENAME request 1824 * Encode RENAME request
1825 */ 1825 */
1826static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs4_rename_arg *args) 1826static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs_renameargs *args)
1827{ 1827{
1828 struct xdr_stream xdr; 1828 struct xdr_stream xdr;
1829 struct compound_hdr hdr = { 1829 struct compound_hdr hdr = {
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 4ef39ae88ea5..0aff10c3bbce 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -370,12 +370,10 @@ nfs_proc_rename(struct inode *old_dir, struct qstr *old_name,
370 struct inode *new_dir, struct qstr *new_name) 370 struct inode *new_dir, struct qstr *new_name)
371{ 371{
372 struct nfs_renameargs arg = { 372 struct nfs_renameargs arg = {
373 .fromfh = NFS_FH(old_dir), 373 .old_dir = NFS_FH(old_dir),
374 .fromname = old_name->name, 374 .old_name = old_name,
375 .fromlen = old_name->len, 375 .new_dir = NFS_FH(new_dir),
376 .tofh = NFS_FH(new_dir), 376 .new_name = new_name,
377 .toname = new_name->name,
378 .tolen = new_name->len
379 }; 377 };
380 struct rpc_message msg = { 378 struct rpc_message msg = {
381 .rpc_proc = &nfs_procedures[NFSPROC_RENAME], 379 .rpc_proc = &nfs_procedures[NFSPROC_RENAME],
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 6f345f8af4ae..acb95fb27bcc 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -400,6 +400,18 @@ struct nfs_removeres {
400}; 400};
401 401
402/* 402/*
403 * Common arguments to the rename call
404 */
405struct nfs_renameargs {
406 const struct nfs_fh *old_dir;
407 const struct nfs_fh *new_dir;
408 const struct qstr *old_name;
409 const struct qstr *new_name;
410 const u32 *bitmask;
411 struct nfs4_sequence_args seq_args;
412};
413
414/*
403 * Argument struct for decode_entry function 415 * Argument struct for decode_entry function
404 */ 416 */
405struct nfs_entry { 417struct nfs_entry {
@@ -434,15 +446,6 @@ struct nfs_createargs {
434 struct iattr * sattr; 446 struct iattr * sattr;
435}; 447};
436 448
437struct nfs_renameargs {
438 struct nfs_fh * fromfh;
439 const char * fromname;
440 unsigned int fromlen;
441 struct nfs_fh * tofh;
442 const char * toname;
443 unsigned int tolen;
444};
445
446struct nfs_setattrargs { 449struct nfs_setattrargs {
447 struct nfs_fh * fh; 450 struct nfs_fh * fh;
448 nfs4_stateid stateid; 451 nfs4_stateid stateid;
@@ -586,15 +589,6 @@ struct nfs3_mknodargs {
586 dev_t rdev; 589 dev_t rdev;
587}; 590};
588 591
589struct nfs3_renameargs {
590 struct nfs_fh * fromfh;
591 const char * fromname;
592 unsigned int fromlen;
593 struct nfs_fh * tofh;
594 const char * toname;
595 unsigned int tolen;
596};
597
598struct nfs3_linkargs { 592struct nfs3_linkargs {
599 struct nfs_fh * fromfh; 593 struct nfs_fh * fromfh;
600 struct nfs_fh * tofh; 594 struct nfs_fh * tofh;
@@ -801,15 +795,6 @@ struct nfs4_readlink_res {
801 struct nfs4_sequence_res seq_res; 795 struct nfs4_sequence_res seq_res;
802}; 796};
803 797
804struct nfs4_rename_arg {
805 const struct nfs_fh * old_dir;
806 const struct nfs_fh * new_dir;
807 const struct qstr * old_name;
808 const struct qstr * new_name;
809 const u32 * bitmask;
810 struct nfs4_sequence_args seq_args;
811};
812
813struct nfs4_rename_res { 798struct nfs4_rename_res {
814 const struct nfs_server * server; 799 const struct nfs_server * server;
815 struct nfs4_change_info old_cinfo; 800 struct nfs4_change_info old_cinfo;