Commit ea443607 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] More rpc cleanup...

Don't share a routing for xdr_encode_mon/umon.

What we really want to do is split the XDR routine into one which does
SM_MON encodes, and the other which does SM_UNMON.

Remove some unused "void" encoders / decoders to avoid compiler warnings.
parent 35abeacb
......@@ -135,16 +135,12 @@ nsm_create(void)
* XDR functions for NSM.
*/
static int
xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
static u32 *
xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
{
char buffer[20];
u32 addr = ntohl(argp->addr);
dprintk("nsm: xdr_encode_mon(%08x, %d, %d, %d)\n",
htonl(argp->addr), htonl(argp->prog),
htonl(argp->vers), htonl(argp->proc));
/*
* Use the dotted-quad IP address of the remote host as
* identifier. Linux statd always looks up the canonical
......@@ -155,19 +151,34 @@ xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
(addr>>8) & 0xff, (addr) & 0xff);
if (!(p = xdr_encode_string(p, buffer))
|| !(p = xdr_encode_string(p, system_utsname.nodename)))
return -EIO;
return ERR_PTR(-EIO);
*p++ = htonl(argp->prog);
*p++ = htonl(argp->vers);
*p++ = htonl(argp->proc);
/* This is the private part. Needed only for SM_MON call */
if (rqstp->rq_task->tk_msg.rpc_proc == SM_MON) {
return p;
}
static int
xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
{
p = xdr_encode_common(rqstp, p, argp);
if (IS_ERR(p))
return PTR_ERR(p);
*p++ = argp->addr;
*p++ = argp->vers;
*p++ = argp->proto;
*p++ = 0;
}
rqstp->rq_slen = xdr_adjust_iovec(rqstp->rq_svec, p);
return 0;
}
static int
xdr_encode_unmon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
{
p = xdr_encode_common(rqstp, p, argp);
if (IS_ERR(p))
return PTR_ERR(p);
rqstp->rq_slen = xdr_adjust_iovec(rqstp->rq_svec, p);
return 0;
}
......@@ -209,7 +220,7 @@ static struct rpc_procinfo nsm_procedures[] = {
},
[SM_UNMON] = {
.p_proc = SM_UNMON,
.p_encode = (kxdrproc_t) xdr_encode_mon,
.p_encode = (kxdrproc_t) xdr_encode_unmon,
.p_decode = (kxdrproc_t) xdr_decode_stat,
.p_bufsiz = MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
},
......
......@@ -379,18 +379,13 @@ nlmsvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
/*
* Now, the client side XDR functions
*/
static int
nlmclt_encode_void(struct rpc_rqst *req, u32 *p, void *ptr)
{
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
return 0;
}
#ifdef NLMCLNT_SUPPORT_SHARES
static int
nlmclt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr)
{
return 0;
}
#endif
static int
nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
......
......@@ -382,18 +382,13 @@ nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
/*
* Now, the client side XDR functions
*/
static int
nlm4clt_encode_void(struct rpc_rqst *req, u32 *p, void *ptr)
{
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
return 0;
}
#ifdef NLMCLNT_SUPPORT_SHARES
static int
nlm4clt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr)
{
return 0;
}
#endif
static int
nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
......
......@@ -44,7 +44,6 @@ extern int nfs_stat_to_errno(int stat);
#define NFS_info_sz 5
#define NFS_entry_sz NFS_filename_sz+3
#define NFS_enc_void_sz 0
#define NFS_diropargs_sz NFS_fhandle_sz+NFS_filename_sz
#define NFS_sattrargs_sz NFS_fhandle_sz+NFS_sattr_sz
#define NFS_readlinkargs_sz NFS_fhandle_sz
......@@ -56,7 +55,6 @@ extern int nfs_stat_to_errno(int stat);
#define NFS_symlinkargs_sz NFS_diropargs_sz+NFS_path_sz+NFS_sattr_sz
#define NFS_readdirargs_sz NFS_fhandle_sz+2
#define NFS_dec_void_sz 0
#define NFS_attrstat_sz 1+NFS_fattr_sz
#define NFS_diropres_sz 1+NFS_fhandle_sz+NFS_fattr_sz
#define NFS_readlinkres_sz 1
......@@ -154,16 +152,6 @@ xdr_encode_sattr(u32 *p, struct iattr *attr)
/*
* NFS encode functions
*/
/*
* Encode void argument
*/
static int
nfs_xdr_enc_void(struct rpc_rqst *req, u32 *p, void *dummy)
{
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
return 0;
}
/*
* Encode file handle argument
* GETATTR, READLINK, STATFS
......@@ -462,15 +450,6 @@ nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus)
/*
* NFS XDR decode functions
*/
/*
* Decode void reply
*/
static int
nfs_xdr_dec_void(struct rpc_rqst *req, u32 *p, void *dummy)
{
return 0;
}
/*
* Decode simple status reply
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment