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>
This commit is contained in:
@ -43,6 +43,7 @@
|
||||
#define NFS_entry_sz (NFS_filename_sz+3)
|
||||
|
||||
#define NFS_diropargs_sz (NFS_fhandle_sz+NFS_filename_sz)
|
||||
#define NFS_removeargs_sz (NFS_fhandle_sz+NFS_filename_sz)
|
||||
#define NFS_sattrargs_sz (NFS_fhandle_sz+NFS_sattr_sz)
|
||||
#define NFS_readlinkargs_sz (NFS_fhandle_sz)
|
||||
#define NFS_readargs_sz (NFS_fhandle_sz+3)
|
||||
@ -66,7 +67,7 @@
|
||||
* Common NFS XDR functions as inlines
|
||||
*/
|
||||
static inline __be32 *
|
||||
xdr_encode_fhandle(__be32 *p, struct nfs_fh *fhandle)
|
||||
xdr_encode_fhandle(__be32 *p, const struct nfs_fh *fhandle)
|
||||
{
|
||||
memcpy(p, fhandle->data, NFS2_FHSIZE);
|
||||
return p + XDR_QUADLEN(NFS2_FHSIZE);
|
||||
@ -204,7 +205,7 @@ nfs_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs_sattrargs *args)
|
||||
|
||||
/*
|
||||
* Encode directory ops argument
|
||||
* LOOKUP, REMOVE, RMDIR
|
||||
* LOOKUP, RMDIR
|
||||
*/
|
||||
static int
|
||||
nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
|
||||
@ -215,6 +216,18 @@ nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode REMOVE argument
|
||||
*/
|
||||
static int
|
||||
nfs_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args)
|
||||
{
|
||||
p = xdr_encode_fhandle(p, args->fh);
|
||||
p = xdr_encode_array(p, args->name.name, args->name.len);
|
||||
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Arguments to a READ call. Since we read data directly into the page
|
||||
* cache, we also set up the reply iovec here so that iov[1] points
|
||||
@ -705,7 +718,7 @@ struct rpc_procinfo nfs_procedures[] = {
|
||||
PROC(READ, readargs, readres, 3),
|
||||
PROC(WRITE, writeargs, writeres, 4),
|
||||
PROC(CREATE, createargs, diropres, 0),
|
||||
PROC(REMOVE, diropargs, stat, 0),
|
||||
PROC(REMOVE, removeargs, stat, 0),
|
||||
PROC(RENAME, renameargs, stat, 0),
|
||||
PROC(LINK, linkargs, stat, 0),
|
||||
PROC(SYMLINK, symlinkargs, stat, 0),
|
||||
|
Reference in New Issue
Block a user