diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-14 15:39:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-19 15:21:39 -0400 |
commit | 4fdc17b2a7f4d9db5b08e0f963d0027f714e4104 (patch) | |
tree | 502aacc94e06962c2f3352b6ced1146245158be1 /fs/nfs/nfs3xdr.c | |
parent | 3062c532ad410fe0e8320566fe2879a396be6701 (diff) |
NFS: Introduce struct nfs_removeargs+nfs_removeres
We need a common structure for setting up an unlink() rpc call in order to
fix the asynchronous unlink code.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3xdr.c')
-rw-r--r-- | fs/nfs/nfs3xdr.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index b4647a22f349..d9e08f0cf2a0 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -50,6 +50,7 @@ | |||
50 | 50 | ||
51 | #define NFS3_sattrargs_sz (NFS3_fh_sz+NFS3_sattr_sz+3) | 51 | #define NFS3_sattrargs_sz (NFS3_fh_sz+NFS3_sattr_sz+3) |
52 | #define NFS3_diropargs_sz (NFS3_fh_sz+NFS3_filename_sz) | 52 | #define NFS3_diropargs_sz (NFS3_fh_sz+NFS3_filename_sz) |
53 | #define NFS3_removeargs_sz (NFS3_fh_sz+NFS3_filename_sz) | ||
53 | #define NFS3_accessargs_sz (NFS3_fh_sz+1) | 54 | #define NFS3_accessargs_sz (NFS3_fh_sz+1) |
54 | #define NFS3_readlinkargs_sz (NFS3_fh_sz) | 55 | #define NFS3_readlinkargs_sz (NFS3_fh_sz) |
55 | #define NFS3_readargs_sz (NFS3_fh_sz+3) | 56 | #define NFS3_readargs_sz (NFS3_fh_sz+3) |
@@ -65,6 +66,7 @@ | |||
65 | 66 | ||
66 | #define NFS3_attrstat_sz (1+NFS3_fattr_sz) | 67 | #define NFS3_attrstat_sz (1+NFS3_fattr_sz) |
67 | #define NFS3_wccstat_sz (1+NFS3_wcc_data_sz) | 68 | #define NFS3_wccstat_sz (1+NFS3_wcc_data_sz) |
69 | #define NFS3_removeres_sz (NFS3_wccstat_sz) | ||
68 | #define NFS3_lookupres_sz (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz)) | 70 | #define NFS3_lookupres_sz (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz)) |
69 | #define NFS3_accessres_sz (1+NFS3_post_op_attr_sz+1) | 71 | #define NFS3_accessres_sz (1+NFS3_post_op_attr_sz+1) |
70 | #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1) | 72 | #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1) |
@@ -106,7 +108,7 @@ static struct { | |||
106 | * Common NFS XDR functions as inlines | 108 | * Common NFS XDR functions as inlines |
107 | */ | 109 | */ |
108 | static inline __be32 * | 110 | static inline __be32 * |
109 | xdr_encode_fhandle(__be32 *p, struct nfs_fh *fh) | 111 | xdr_encode_fhandle(__be32 *p, const struct nfs_fh *fh) |
110 | { | 112 | { |
111 | return xdr_encode_array(p, fh->data, fh->size); | 113 | return xdr_encode_array(p, fh->data, fh->size); |
112 | } | 114 | } |
@@ -300,6 +302,18 @@ nfs3_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs3_diropargs *args) | |||
300 | } | 302 | } |
301 | 303 | ||
302 | /* | 304 | /* |
305 | * Encode REMOVE argument | ||
306 | */ | ||
307 | static int | ||
308 | nfs3_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args) | ||
309 | { | ||
310 | p = xdr_encode_fhandle(p, args->fh); | ||
311 | p = xdr_encode_array(p, args->name.name, args->name.len); | ||
312 | req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); | ||
313 | return 0; | ||
314 | } | ||
315 | |||
316 | /* | ||
303 | * Encode access() argument | 317 | * Encode access() argument |
304 | */ | 318 | */ |
305 | static int | 319 | static int |
@@ -736,6 +750,12 @@ nfs3_xdr_wccstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) | |||
736 | return status; | 750 | return status; |
737 | } | 751 | } |
738 | 752 | ||
753 | static int | ||
754 | nfs3_xdr_removeres(struct rpc_rqst *req, __be32 *p, struct nfs_removeres *res) | ||
755 | { | ||
756 | return nfs3_xdr_wccstat(req, p, &res->dir_attr); | ||
757 | } | ||
758 | |||
739 | /* | 759 | /* |
740 | * Decode LOOKUP reply | 760 | * Decode LOOKUP reply |
741 | */ | 761 | */ |
@@ -1126,7 +1146,7 @@ struct rpc_procinfo nfs3_procedures[] = { | |||
1126 | PROC(MKDIR, mkdirargs, createres, 0), | 1146 | PROC(MKDIR, mkdirargs, createres, 0), |
1127 | PROC(SYMLINK, symlinkargs, createres, 0), | 1147 | PROC(SYMLINK, symlinkargs, createres, 0), |
1128 | PROC(MKNOD, mknodargs, createres, 0), | 1148 | PROC(MKNOD, mknodargs, createres, 0), |
1129 | PROC(REMOVE, diropargs, wccstat, 0), | 1149 | PROC(REMOVE, removeargs, removeres, 0), |
1130 | PROC(RMDIR, diropargs, wccstat, 0), | 1150 | PROC(RMDIR, diropargs, wccstat, 0), |
1131 | PROC(RENAME, renameargs, renameres, 0), | 1151 | PROC(RENAME, renameargs, renameres, 0), |
1132 | PROC(LINK, linkargs, linkres, 0), | 1152 | PROC(LINK, linkargs, linkres, 0), |