diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-17 17:31:06 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-17 17:31:06 -0400 |
commit | e8582a8b96f329083b4da29aa87bc43cc0d80dd1 (patch) | |
tree | f0efdb995432c3559e6827994dcd3e77fa8c120e /fs | |
parent | 920769f031a8aff87b66bdf49d1a0d0988241ef9 (diff) |
nfs: standardize the rename response container
Right now, v3 and v4 have their own variants. Create a standard struct
that will work for v3 and v4. v2 doesn't get anything but a simple error
and so isn't affected by this.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs3proc.c | 16 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 2 |
4 files changed, 13 insertions, 13 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); |
469 | out: | 469 | out: |
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 | */ |
972 | static int | 972 | static int |
973 | nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs3_renameres *res) | 973 | nfs3_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 | */ |
4876 | static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_rename_res *res) | 4876 | static 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; |