aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs2xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:39:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-19 15:21:39 -0400
commit4fdc17b2a7f4d9db5b08e0f963d0027f714e4104 (patch)
tree502aacc94e06962c2f3352b6ced1146245158be1 /fs/nfs/nfs2xdr.c
parent3062c532ad410fe0e8320566fe2879a396be6701 (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/nfs2xdr.c')
-rw-r--r--fs/nfs/nfs2xdr.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 7fcc78f2aa71..c5fce7567200 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -43,6 +43,7 @@
43#define NFS_entry_sz (NFS_filename_sz+3) 43#define NFS_entry_sz (NFS_filename_sz+3)
44 44
45#define NFS_diropargs_sz (NFS_fhandle_sz+NFS_filename_sz) 45#define NFS_diropargs_sz (NFS_fhandle_sz+NFS_filename_sz)
46#define NFS_removeargs_sz (NFS_fhandle_sz+NFS_filename_sz)
46#define NFS_sattrargs_sz (NFS_fhandle_sz+NFS_sattr_sz) 47#define NFS_sattrargs_sz (NFS_fhandle_sz+NFS_sattr_sz)
47#define NFS_readlinkargs_sz (NFS_fhandle_sz) 48#define NFS_readlinkargs_sz (NFS_fhandle_sz)
48#define NFS_readargs_sz (NFS_fhandle_sz+3) 49#define NFS_readargs_sz (NFS_fhandle_sz+3)
@@ -66,7 +67,7 @@
66 * Common NFS XDR functions as inlines 67 * Common NFS XDR functions as inlines
67 */ 68 */
68static inline __be32 * 69static inline __be32 *
69xdr_encode_fhandle(__be32 *p, struct nfs_fh *fhandle) 70xdr_encode_fhandle(__be32 *p, const struct nfs_fh *fhandle)
70{ 71{
71 memcpy(p, fhandle->data, NFS2_FHSIZE); 72 memcpy(p, fhandle->data, NFS2_FHSIZE);
72 return p + XDR_QUADLEN(NFS2_FHSIZE); 73 return p + XDR_QUADLEN(NFS2_FHSIZE);
@@ -204,7 +205,7 @@ nfs_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs_sattrargs *args)
204 205
205/* 206/*
206 * Encode directory ops argument 207 * Encode directory ops argument
207 * LOOKUP, REMOVE, RMDIR 208 * LOOKUP, RMDIR
208 */ 209 */
209static int 210static int
210nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args) 211nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
@@ -216,6 +217,18 @@ nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
216} 217}
217 218
218/* 219/*
220 * Encode REMOVE argument
221 */
222static int
223nfs_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args)
224{
225 p = xdr_encode_fhandle(p, args->fh);
226 p = xdr_encode_array(p, args->name.name, args->name.len);
227 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
228 return 0;
229}
230
231/*
219 * Arguments to a READ call. Since we read data directly into the page 232 * Arguments to a READ call. Since we read data directly into the page
220 * cache, we also set up the reply iovec here so that iov[1] points 233 * cache, we also set up the reply iovec here so that iov[1] points
221 * exactly to the page we want to fetch. 234 * exactly to the page we want to fetch.
@@ -705,7 +718,7 @@ struct rpc_procinfo nfs_procedures[] = {
705 PROC(READ, readargs, readres, 3), 718 PROC(READ, readargs, readres, 3),
706 PROC(WRITE, writeargs, writeres, 4), 719 PROC(WRITE, writeargs, writeres, 4),
707 PROC(CREATE, createargs, diropres, 0), 720 PROC(CREATE, createargs, diropres, 0),
708 PROC(REMOVE, diropargs, stat, 0), 721 PROC(REMOVE, removeargs, stat, 0),
709 PROC(RENAME, renameargs, stat, 0), 722 PROC(RENAME, renameargs, stat, 0),
710 PROC(LINK, linkargs, stat, 0), 723 PROC(LINK, linkargs, stat, 0),
711 PROC(SYMLINK, symlinkargs, stat, 0), 724 PROC(SYMLINK, symlinkargs, stat, 0),