Commit d16d1867 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Anna Schumaker

sunrpc: properly type pc_encode callbacks

Drop the resp argument as it can trivially be derived from the rqstp
argument.  With that all functions now have the same prototype, and we
can remove the unsafe casting to kxdrproc_t.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent cc6acc20
...@@ -497,7 +497,7 @@ struct nlm_void { int dummy; }; ...@@ -497,7 +497,7 @@ struct nlm_void { int dummy; };
#define PROC(name, xargt, xrest, argt, rest, respsize) \ #define PROC(name, xargt, xrest, argt, rest, respsize) \
{ .pc_func = nlm4svc_proc_##name, \ { .pc_func = nlm4svc_proc_##name, \
.pc_decode = nlm4svc_decode_##xargt, \ .pc_decode = nlm4svc_decode_##xargt, \
.pc_encode = (kxdrproc_t) nlm4svc_encode_##xrest, \ .pc_encode = nlm4svc_encode_##xrest, \
.pc_release = NULL, \ .pc_release = NULL, \
.pc_argsize = sizeof(struct nlm_##argt), \ .pc_argsize = sizeof(struct nlm_##argt), \
.pc_ressize = sizeof(struct nlm_##rest), \ .pc_ressize = sizeof(struct nlm_##rest), \
......
...@@ -539,7 +539,7 @@ struct nlm_void { int dummy; }; ...@@ -539,7 +539,7 @@ struct nlm_void { int dummy; };
#define PROC(name, xargt, xrest, argt, rest, respsize) \ #define PROC(name, xargt, xrest, argt, rest, respsize) \
{ .pc_func = nlmsvc_proc_##name, \ { .pc_func = nlmsvc_proc_##name, \
.pc_decode = nlmsvc_decode_##xargt, \ .pc_decode = nlmsvc_decode_##xargt, \
.pc_encode = (kxdrproc_t) nlmsvc_encode_##xrest, \ .pc_encode = nlmsvc_encode_##xrest, \
.pc_release = NULL, \ .pc_release = NULL, \
.pc_argsize = sizeof(struct nlm_##argt), \ .pc_argsize = sizeof(struct nlm_##argt), \
.pc_ressize = sizeof(struct nlm_##rest), \ .pc_ressize = sizeof(struct nlm_##rest), \
......
...@@ -200,8 +200,10 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -200,8 +200,10 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm_encode_testres(p, resp))) if (!(p = nlm_encode_testres(p, resp)))
return 0; return 0;
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -280,8 +282,10 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -280,8 +282,10 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm_encode_cookie(p, &resp->cookie))) if (!(p = nlm_encode_cookie(p, &resp->cookie)))
return 0; return 0;
*p++ = resp->status; *p++ = resp->status;
...@@ -290,8 +294,10 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) ...@@ -290,8 +294,10 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
} }
int int
nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm_encode_cookie(p, &resp->cookie))) if (!(p = nlm_encode_cookie(p, &resp->cookie)))
return 0; return 0;
*p++ = resp->status; *p++ = resp->status;
...@@ -342,7 +348,7 @@ nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p) ...@@ -342,7 +348,7 @@ nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
...@@ -197,8 +197,10 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -197,8 +197,10 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm4_encode_testres(p, resp))) if (!(p = nlm4_encode_testres(p, resp)))
return 0; return 0;
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -277,8 +279,10 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -277,8 +279,10 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm4_encode_cookie(p, &resp->cookie))) if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
return 0; return 0;
*p++ = resp->status; *p++ = resp->status;
...@@ -287,8 +291,10 @@ nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) ...@@ -287,8 +291,10 @@ nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
} }
int int
nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p)
{ {
struct nlm_res *resp = rqstp->rq_resp;
if (!(p = nlm4_encode_cookie(p, &resp->cookie))) if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
return 0; return 0;
*p++ = resp->status; *p++ = resp->status;
...@@ -339,7 +345,7 @@ nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p) ...@@ -339,7 +345,7 @@ nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
...@@ -63,7 +63,7 @@ static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p) ...@@ -63,7 +63,7 @@ static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p)
return xdr_argsize_check(rqstp, p); return xdr_argsize_check(rqstp, p);
} }
static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
...@@ -999,12 +999,12 @@ static struct svc_procedure nfs4_callback_procedures1[] = { ...@@ -999,12 +999,12 @@ static struct svc_procedure nfs4_callback_procedures1[] = {
[CB_NULL] = { [CB_NULL] = {
.pc_func = nfs4_callback_null, .pc_func = nfs4_callback_null,
.pc_decode = nfs4_decode_void, .pc_decode = nfs4_decode_void,
.pc_encode = (kxdrproc_t)nfs4_encode_void, .pc_encode = nfs4_encode_void,
.pc_xdrressize = 1, .pc_xdrressize = 1,
}, },
[CB_COMPOUND] = { [CB_COMPOUND] = {
.pc_func = nfs4_callback_compound, .pc_func = nfs4_callback_compound,
.pc_encode = (kxdrproc_t)nfs4_encode_void, .pc_encode = nfs4_encode_void,
.pc_argsize = 256, .pc_argsize = 256,
.pc_ressize = 256, .pc_ressize = 256,
.pc_xdrressize = NFS4_CALLBACK_BUFSIZE, .pc_xdrressize = NFS4_CALLBACK_BUFSIZE,
......
...@@ -251,15 +251,15 @@ static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -251,15 +251,15 @@ static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
* There must be an encoding function for void results so svc_process * There must be an encoding function for void results so svc_process
* will work properly. * will work properly.
*/ */
static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
/* GETACL */ /* GETACL */
static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_getaclres *resp)
{ {
struct nfsd3_getaclres *resp = rqstp->rq_resp;
struct dentry *dentry = resp->fh.fh_dentry; struct dentry *dentry = resp->fh.fh_dentry;
struct inode *inode; struct inode *inode;
struct kvec *head = rqstp->rq_res.head; struct kvec *head = rqstp->rq_res.head;
...@@ -302,17 +302,19 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, ...@@ -302,17 +302,19 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
return (n > 0); return (n > 0);
} }
static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p, static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_attrstat *resp)
{ {
struct nfsd_attrstat *resp = rqstp->rq_resp;
p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
/* ACCESS */ /* ACCESS */
static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_accessres *resp)
{ {
struct nfsd3_accessres *resp = rqstp->rq_resp;
p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
*p++ = htonl(resp->access); *p++ = htonl(resp->access);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -355,7 +357,7 @@ struct nfsd3_voidargs { int dummy; }; ...@@ -355,7 +357,7 @@ struct nfsd3_voidargs { int dummy; };
{ \ { \
.pc_func = nfsacld_proc_##name, \ .pc_func = nfsacld_proc_##name, \
.pc_decode = nfsaclsvc_decode_##argt##args, \ .pc_decode = nfsaclsvc_decode_##argt##args, \
.pc_encode = (kxdrproc_t) nfsaclsvc_encode_##rest##res, \ .pc_encode = nfsaclsvc_encode_##rest##res, \
.pc_release = nfsaclsvc_release_##relt, \ .pc_release = nfsaclsvc_release_##relt, \
.pc_argsize = sizeof(struct nfsd3_##argt##args), \ .pc_argsize = sizeof(struct nfsd3_##argt##args), \
.pc_ressize = sizeof(struct nfsd3_##rest##res), \ .pc_ressize = sizeof(struct nfsd3_##rest##res), \
......
...@@ -168,9 +168,9 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -168,9 +168,9 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
*/ */
/* GETACL */ /* GETACL */
static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_getaclres *resp)
{ {
struct nfsd3_getaclres *resp = rqstp->rq_resp;
struct dentry *dentry = resp->fh.fh_dentry; struct dentry *dentry = resp->fh.fh_dentry;
p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
...@@ -213,9 +213,10 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, ...@@ -213,9 +213,10 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
} }
/* SETACL */ /* SETACL */
static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p, static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_attrstat *resp)
{ {
struct nfsd3_attrstat *resp = rqstp->rq_resp;
p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -243,7 +244,7 @@ struct nfsd3_voidargs { int dummy; }; ...@@ -243,7 +244,7 @@ struct nfsd3_voidargs { int dummy; };
{ \ { \
.pc_func = nfsd3_proc_##name, \ .pc_func = nfsd3_proc_##name, \
.pc_decode = nfs3svc_decode_##argt##args, \ .pc_decode = nfs3svc_decode_##argt##args, \
.pc_encode = (kxdrproc_t) nfs3svc_encode_##rest##res, \ .pc_encode = nfs3svc_encode_##rest##res, \
.pc_release = nfs3svc_release_##relt, \ .pc_release = nfs3svc_release_##relt, \
.pc_argsize = sizeof(struct nfsd3_##argt##args), \ .pc_argsize = sizeof(struct nfsd3_##argt##args), \
.pc_ressize = sizeof(struct nfsd3_##rest##res), \ .pc_ressize = sizeof(struct nfsd3_##rest##res), \
......
...@@ -677,7 +677,7 @@ struct nfsd3_voidargs { int dummy; }; ...@@ -677,7 +677,7 @@ struct nfsd3_voidargs { int dummy; };
static struct svc_procedure nfsd_procedures3[22] = { static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_NULL] = { [NFS3PROC_NULL] = {
.pc_func = nfsd3_proc_null, .pc_func = nfsd3_proc_null,
.pc_encode = (kxdrproc_t) nfs3svc_encode_voidres, .pc_encode = nfs3svc_encode_voidres,
.pc_argsize = sizeof(struct nfsd3_voidargs), .pc_argsize = sizeof(struct nfsd3_voidargs),
.pc_ressize = sizeof(struct nfsd3_voidres), .pc_ressize = sizeof(struct nfsd3_voidres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -686,7 +686,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -686,7 +686,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_GETATTR] = { [NFS3PROC_GETATTR] = {
.pc_func = nfsd3_proc_getattr, .pc_func = nfsd3_proc_getattr,
.pc_decode = nfs3svc_decode_fhandleargs, .pc_decode = nfs3svc_decode_fhandleargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres, .pc_encode = nfs3svc_encode_attrstatres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_fhandleargs), .pc_argsize = sizeof(struct nfsd3_fhandleargs),
.pc_ressize = sizeof(struct nfsd3_attrstatres), .pc_ressize = sizeof(struct nfsd3_attrstatres),
...@@ -696,7 +696,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -696,7 +696,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_SETATTR] = { [NFS3PROC_SETATTR] = {
.pc_func = nfsd3_proc_setattr, .pc_func = nfsd3_proc_setattr,
.pc_decode = nfs3svc_decode_sattrargs, .pc_decode = nfs3svc_decode_sattrargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, .pc_encode = nfs3svc_encode_wccstatres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_sattrargs), .pc_argsize = sizeof(struct nfsd3_sattrargs),
.pc_ressize = sizeof(struct nfsd3_wccstatres), .pc_ressize = sizeof(struct nfsd3_wccstatres),
...@@ -706,7 +706,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -706,7 +706,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_LOOKUP] = { [NFS3PROC_LOOKUP] = {
.pc_func = nfsd3_proc_lookup, .pc_func = nfsd3_proc_lookup,
.pc_decode = nfs3svc_decode_diropargs, .pc_decode = nfs3svc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_diropres, .pc_encode = nfs3svc_encode_diropres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_diropargs), .pc_argsize = sizeof(struct nfsd3_diropargs),
.pc_ressize = sizeof(struct nfsd3_diropres), .pc_ressize = sizeof(struct nfsd3_diropres),
...@@ -716,7 +716,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -716,7 +716,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_ACCESS] = { [NFS3PROC_ACCESS] = {
.pc_func = nfsd3_proc_access, .pc_func = nfsd3_proc_access,
.pc_decode = nfs3svc_decode_accessargs, .pc_decode = nfs3svc_decode_accessargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_accessres, .pc_encode = nfs3svc_encode_accessres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_accessargs), .pc_argsize = sizeof(struct nfsd3_accessargs),
.pc_ressize = sizeof(struct nfsd3_accessres), .pc_ressize = sizeof(struct nfsd3_accessres),
...@@ -726,7 +726,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -726,7 +726,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_READLINK] = { [NFS3PROC_READLINK] = {
.pc_func = nfsd3_proc_readlink, .pc_func = nfsd3_proc_readlink,
.pc_decode = nfs3svc_decode_readlinkargs, .pc_decode = nfs3svc_decode_readlinkargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres, .pc_encode = nfs3svc_encode_readlinkres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_readlinkargs), .pc_argsize = sizeof(struct nfsd3_readlinkargs),
.pc_ressize = sizeof(struct nfsd3_readlinkres), .pc_ressize = sizeof(struct nfsd3_readlinkres),
...@@ -736,7 +736,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -736,7 +736,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_READ] = { [NFS3PROC_READ] = {
.pc_func = nfsd3_proc_read, .pc_func = nfsd3_proc_read,
.pc_decode = nfs3svc_decode_readargs, .pc_decode = nfs3svc_decode_readargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_readres, .pc_encode = nfs3svc_encode_readres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_readargs), .pc_argsize = sizeof(struct nfsd3_readargs),
.pc_ressize = sizeof(struct nfsd3_readres), .pc_ressize = sizeof(struct nfsd3_readres),
...@@ -746,7 +746,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -746,7 +746,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_WRITE] = { [NFS3PROC_WRITE] = {
.pc_func = nfsd3_proc_write, .pc_func = nfsd3_proc_write,
.pc_decode = nfs3svc_decode_writeargs, .pc_decode = nfs3svc_decode_writeargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_writeres, .pc_encode = nfs3svc_encode_writeres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_writeargs), .pc_argsize = sizeof(struct nfsd3_writeargs),
.pc_ressize = sizeof(struct nfsd3_writeres), .pc_ressize = sizeof(struct nfsd3_writeres),
...@@ -756,7 +756,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -756,7 +756,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_CREATE] = { [NFS3PROC_CREATE] = {
.pc_func = nfsd3_proc_create, .pc_func = nfsd3_proc_create,
.pc_decode = nfs3svc_decode_createargs, .pc_decode = nfs3svc_decode_createargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_createres, .pc_encode = nfs3svc_encode_createres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_createargs), .pc_argsize = sizeof(struct nfsd3_createargs),
.pc_ressize = sizeof(struct nfsd3_createres), .pc_ressize = sizeof(struct nfsd3_createres),
...@@ -766,7 +766,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -766,7 +766,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_MKDIR] = { [NFS3PROC_MKDIR] = {
.pc_func = nfsd3_proc_mkdir, .pc_func = nfsd3_proc_mkdir,
.pc_decode = nfs3svc_decode_mkdirargs, .pc_decode = nfs3svc_decode_mkdirargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_createres, .pc_encode = nfs3svc_encode_createres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_mkdirargs), .pc_argsize = sizeof(struct nfsd3_mkdirargs),
.pc_ressize = sizeof(struct nfsd3_createres), .pc_ressize = sizeof(struct nfsd3_createres),
...@@ -776,7 +776,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -776,7 +776,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_SYMLINK] = { [NFS3PROC_SYMLINK] = {
.pc_func = nfsd3_proc_symlink, .pc_func = nfsd3_proc_symlink,
.pc_decode = nfs3svc_decode_symlinkargs, .pc_decode = nfs3svc_decode_symlinkargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_createres, .pc_encode = nfs3svc_encode_createres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_symlinkargs), .pc_argsize = sizeof(struct nfsd3_symlinkargs),
.pc_ressize = sizeof(struct nfsd3_createres), .pc_ressize = sizeof(struct nfsd3_createres),
...@@ -786,7 +786,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -786,7 +786,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_MKNOD] = { [NFS3PROC_MKNOD] = {
.pc_func = nfsd3_proc_mknod, .pc_func = nfsd3_proc_mknod,
.pc_decode = nfs3svc_decode_mknodargs, .pc_decode = nfs3svc_decode_mknodargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_createres, .pc_encode = nfs3svc_encode_createres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_mknodargs), .pc_argsize = sizeof(struct nfsd3_mknodargs),
.pc_ressize = sizeof(struct nfsd3_createres), .pc_ressize = sizeof(struct nfsd3_createres),
...@@ -796,7 +796,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -796,7 +796,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_REMOVE] = { [NFS3PROC_REMOVE] = {
.pc_func = nfsd3_proc_remove, .pc_func = nfsd3_proc_remove,
.pc_decode = nfs3svc_decode_diropargs, .pc_decode = nfs3svc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, .pc_encode = nfs3svc_encode_wccstatres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_diropargs), .pc_argsize = sizeof(struct nfsd3_diropargs),
.pc_ressize = sizeof(struct nfsd3_wccstatres), .pc_ressize = sizeof(struct nfsd3_wccstatres),
...@@ -806,7 +806,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -806,7 +806,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_RMDIR] = { [NFS3PROC_RMDIR] = {
.pc_func = nfsd3_proc_rmdir, .pc_func = nfsd3_proc_rmdir,
.pc_decode = nfs3svc_decode_diropargs, .pc_decode = nfs3svc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, .pc_encode = nfs3svc_encode_wccstatres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_diropargs), .pc_argsize = sizeof(struct nfsd3_diropargs),
.pc_ressize = sizeof(struct nfsd3_wccstatres), .pc_ressize = sizeof(struct nfsd3_wccstatres),
...@@ -816,7 +816,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -816,7 +816,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_RENAME] = { [NFS3PROC_RENAME] = {
.pc_func = nfsd3_proc_rename, .pc_func = nfsd3_proc_rename,
.pc_decode = nfs3svc_decode_renameargs, .pc_decode = nfs3svc_decode_renameargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_renameres, .pc_encode = nfs3svc_encode_renameres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_renameargs), .pc_argsize = sizeof(struct nfsd3_renameargs),
.pc_ressize = sizeof(struct nfsd3_renameres), .pc_ressize = sizeof(struct nfsd3_renameres),
...@@ -826,7 +826,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -826,7 +826,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_LINK] = { [NFS3PROC_LINK] = {
.pc_func = nfsd3_proc_link, .pc_func = nfsd3_proc_link,
.pc_decode = nfs3svc_decode_linkargs, .pc_decode = nfs3svc_decode_linkargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_linkres, .pc_encode = nfs3svc_encode_linkres,
.pc_release = nfs3svc_release_fhandle2, .pc_release = nfs3svc_release_fhandle2,
.pc_argsize = sizeof(struct nfsd3_linkargs), .pc_argsize = sizeof(struct nfsd3_linkargs),
.pc_ressize = sizeof(struct nfsd3_linkres), .pc_ressize = sizeof(struct nfsd3_linkres),
...@@ -836,7 +836,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -836,7 +836,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_READDIR] = { [NFS3PROC_READDIR] = {
.pc_func = nfsd3_proc_readdir, .pc_func = nfsd3_proc_readdir,
.pc_decode = nfs3svc_decode_readdirargs, .pc_decode = nfs3svc_decode_readdirargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, .pc_encode = nfs3svc_encode_readdirres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_readdirargs), .pc_argsize = sizeof(struct nfsd3_readdirargs),
.pc_ressize = sizeof(struct nfsd3_readdirres), .pc_ressize = sizeof(struct nfsd3_readdirres),
...@@ -845,7 +845,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -845,7 +845,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_READDIRPLUS] = { [NFS3PROC_READDIRPLUS] = {
.pc_func = nfsd3_proc_readdirplus, .pc_func = nfsd3_proc_readdirplus,
.pc_decode = nfs3svc_decode_readdirplusargs, .pc_decode = nfs3svc_decode_readdirplusargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, .pc_encode = nfs3svc_encode_readdirres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_readdirplusargs), .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
.pc_ressize = sizeof(struct nfsd3_readdirres), .pc_ressize = sizeof(struct nfsd3_readdirres),
...@@ -854,7 +854,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -854,7 +854,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_FSSTAT] = { [NFS3PROC_FSSTAT] = {
.pc_func = nfsd3_proc_fsstat, .pc_func = nfsd3_proc_fsstat,
.pc_decode = nfs3svc_decode_fhandleargs, .pc_decode = nfs3svc_decode_fhandleargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres, .pc_encode = nfs3svc_encode_fsstatres,
.pc_argsize = sizeof(struct nfsd3_fhandleargs), .pc_argsize = sizeof(struct nfsd3_fhandleargs),
.pc_ressize = sizeof(struct nfsd3_fsstatres), .pc_ressize = sizeof(struct nfsd3_fsstatres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -863,7 +863,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -863,7 +863,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_FSINFO] = { [NFS3PROC_FSINFO] = {
.pc_func = nfsd3_proc_fsinfo, .pc_func = nfsd3_proc_fsinfo,
.pc_decode = nfs3svc_decode_fhandleargs, .pc_decode = nfs3svc_decode_fhandleargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores, .pc_encode = nfs3svc_encode_fsinfores,
.pc_argsize = sizeof(struct nfsd3_fhandleargs), .pc_argsize = sizeof(struct nfsd3_fhandleargs),
.pc_ressize = sizeof(struct nfsd3_fsinfores), .pc_ressize = sizeof(struct nfsd3_fsinfores),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -872,7 +872,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -872,7 +872,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_PATHCONF] = { [NFS3PROC_PATHCONF] = {
.pc_func = nfsd3_proc_pathconf, .pc_func = nfsd3_proc_pathconf,
.pc_decode = nfs3svc_decode_fhandleargs, .pc_decode = nfs3svc_decode_fhandleargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres, .pc_encode = nfs3svc_encode_pathconfres,
.pc_argsize = sizeof(struct nfsd3_fhandleargs), .pc_argsize = sizeof(struct nfsd3_fhandleargs),
.pc_ressize = sizeof(struct nfsd3_pathconfres), .pc_ressize = sizeof(struct nfsd3_pathconfres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -881,7 +881,7 @@ static struct svc_procedure nfsd_procedures3[22] = { ...@@ -881,7 +881,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
[NFS3PROC_COMMIT] = { [NFS3PROC_COMMIT] = {
.pc_func = nfsd3_proc_commit, .pc_func = nfsd3_proc_commit,
.pc_decode = nfs3svc_decode_commitargs, .pc_decode = nfs3svc_decode_commitargs,
.pc_encode = (kxdrproc_t) nfs3svc_encode_commitres, .pc_encode = nfs3svc_encode_commitres,
.pc_release = nfs3svc_release_fhandle, .pc_release = nfs3svc_release_fhandle,
.pc_argsize = sizeof(struct nfsd3_commitargs), .pc_argsize = sizeof(struct nfsd3_commitargs),
.pc_ressize = sizeof(struct nfsd3_commitres), .pc_ressize = sizeof(struct nfsd3_commitres),
......
...@@ -634,16 +634,17 @@ nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -634,16 +634,17 @@ nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p)
* will work properly. * will work properly.
*/ */
int int
nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
/* GETATTR */ /* GETATTR */
int int
nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_attrstat *resp)
{ {
struct nfsd3_attrstat *resp = rqstp->rq_resp;
if (resp->status == 0) { if (resp->status == 0) {
lease_get_mtime(d_inode(resp->fh.fh_dentry), lease_get_mtime(d_inode(resp->fh.fh_dentry),
&resp->stat.mtime); &resp->stat.mtime);
...@@ -654,18 +655,20 @@ nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, ...@@ -654,18 +655,20 @@ nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p,
/* SETATTR, REMOVE, RMDIR */ /* SETATTR, REMOVE, RMDIR */
int int
nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_attrstat *resp)
{ {
struct nfsd3_attrstat *resp = rqstp->rq_resp;
p = encode_wcc_data(rqstp, p, &resp->fh); p = encode_wcc_data(rqstp, p, &resp->fh);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
/* LOOKUP */ /* LOOKUP */
int int
nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_diropres *resp)
{ {
struct nfsd3_diropres *resp = rqstp->rq_resp;
if (resp->status == 0) { if (resp->status == 0) {
p = encode_fh(p, &resp->fh); p = encode_fh(p, &resp->fh);
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
...@@ -676,9 +679,10 @@ nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, ...@@ -676,9 +679,10 @@ nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p,
/* ACCESS */ /* ACCESS */
int int
nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_accessres *resp)
{ {
struct nfsd3_accessres *resp = rqstp->rq_resp;
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
if (resp->status == 0) if (resp->status == 0)
*p++ = htonl(resp->access); *p++ = htonl(resp->access);
...@@ -687,9 +691,10 @@ nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, ...@@ -687,9 +691,10 @@ nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
/* READLINK */ /* READLINK */
int int
nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_readlinkres *resp)
{ {
struct nfsd3_readlinkres *resp = rqstp->rq_resp;
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
if (resp->status == 0) { if (resp->status == 0) {
*p++ = htonl(resp->len); *p++ = htonl(resp->len);
...@@ -708,9 +713,10 @@ nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, ...@@ -708,9 +713,10 @@ nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
/* READ */ /* READ */
int int
nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_readres *resp)
{ {
struct nfsd3_readres *resp = rqstp->rq_resp;
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
if (resp->status == 0) { if (resp->status == 0) {
*p++ = htonl(resp->count); *p++ = htonl(resp->count);
...@@ -732,9 +738,9 @@ nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p, ...@@ -732,9 +738,9 @@ nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
/* WRITE */ /* WRITE */
int int
nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_writeres *resp)
{ {
struct nfsd3_writeres *resp = rqstp->rq_resp;
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
p = encode_wcc_data(rqstp, p, &resp->fh); p = encode_wcc_data(rqstp, p, &resp->fh);
...@@ -749,9 +755,10 @@ nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p, ...@@ -749,9 +755,10 @@ nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p,
/* CREATE, MKDIR, SYMLINK, MKNOD */ /* CREATE, MKDIR, SYMLINK, MKNOD */
int int
nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_diropres *resp)
{ {
struct nfsd3_diropres *resp = rqstp->rq_resp;
if (resp->status == 0) { if (resp->status == 0) {
*p++ = xdr_one; *p++ = xdr_one;
p = encode_fh(p, &resp->fh); p = encode_fh(p, &resp->fh);
...@@ -763,9 +770,10 @@ nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p, ...@@ -763,9 +770,10 @@ nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p,
/* RENAME */ /* RENAME */
int int
nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_renameres *resp)
{ {
struct nfsd3_renameres *resp = rqstp->rq_resp;
p = encode_wcc_data(rqstp, p, &resp->ffh); p = encode_wcc_data(rqstp, p, &resp->ffh);
p = encode_wcc_data(rqstp, p, &resp->tfh); p = encode_wcc_data(rqstp, p, &resp->tfh);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -773,9 +781,10 @@ nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p, ...@@ -773,9 +781,10 @@ nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p,
/* LINK */ /* LINK */
int int
nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_linkres *resp)
{ {
struct nfsd3_linkres *resp = rqstp->rq_resp;
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
p = encode_wcc_data(rqstp, p, &resp->tfh); p = encode_wcc_data(rqstp, p, &resp->tfh);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
...@@ -783,9 +792,10 @@ nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p, ...@@ -783,9 +792,10 @@ nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p,
/* READDIR */ /* READDIR */
int int
nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_readdirres *resp)
{ {
struct nfsd3_readdirres *resp = rqstp->rq_resp;
p = encode_post_op_attr(rqstp, p, &resp->fh); p = encode_post_op_attr(rqstp, p, &resp->fh);
if (resp->status == 0) { if (resp->status == 0) {
...@@ -1033,9 +1043,9 @@ nfs3svc_encode_entry_plus(void *cd, const char *name, ...@@ -1033,9 +1043,9 @@ nfs3svc_encode_entry_plus(void *cd, const char *name,
/* FSSTAT */ /* FSSTAT */
int int
nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_fsstatres *resp)
{ {
struct nfsd3_fsstatres *resp = rqstp->rq_resp;
struct kstatfs *s = &resp->stats; struct kstatfs *s = &resp->stats;
u64 bs = s->f_bsize; u64 bs = s->f_bsize;
...@@ -1055,9 +1065,10 @@ nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p, ...@@ -1055,9 +1065,10 @@ nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p,
/* FSINFO */ /* FSINFO */
int int
nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_fsinfores *resp)
{ {
struct nfsd3_fsinfores *resp = rqstp->rq_resp;
*p++ = xdr_zero; /* no post_op_attr */ *p++ = xdr_zero; /* no post_op_attr */
if (resp->status == 0) { if (resp->status == 0) {
...@@ -1079,9 +1090,10 @@ nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p, ...@@ -1079,9 +1090,10 @@ nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p,
/* PATHCONF */ /* PATHCONF */
int int
nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_pathconfres *resp)
{ {
struct nfsd3_pathconfres *resp = rqstp->rq_resp;
*p++ = xdr_zero; /* no post_op_attr */ *p++ = xdr_zero; /* no post_op_attr */
if (resp->status == 0) { if (resp->status == 0) {
...@@ -1098,9 +1110,9 @@ nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p, ...@@ -1098,9 +1110,9 @@ nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p,
/* COMMIT */ /* COMMIT */
int int
nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p, nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd3_commitres *resp)
{ {
struct nfsd3_commitres *resp = rqstp->rq_resp;
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
p = encode_wcc_data(rqstp, p, &resp->fh); p = encode_wcc_data(rqstp, p, &resp->fh);
......
...@@ -2519,7 +2519,7 @@ struct nfsd4_voidargs { int dummy; }; ...@@ -2519,7 +2519,7 @@ struct nfsd4_voidargs { int dummy; };
static struct svc_procedure nfsd_procedures4[2] = { static struct svc_procedure nfsd_procedures4[2] = {
[NFSPROC4_NULL] = { [NFSPROC4_NULL] = {
.pc_func = nfsd4_proc_null, .pc_func = nfsd4_proc_null,
.pc_encode = (kxdrproc_t) nfs4svc_encode_voidres, .pc_encode = nfs4svc_encode_voidres,
.pc_argsize = sizeof(struct nfsd4_voidargs), .pc_argsize = sizeof(struct nfsd4_voidargs),
.pc_ressize = sizeof(struct nfsd4_voidres), .pc_ressize = sizeof(struct nfsd4_voidres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -2528,7 +2528,7 @@ static struct svc_procedure nfsd_procedures4[2] = { ...@@ -2528,7 +2528,7 @@ static struct svc_procedure nfsd_procedures4[2] = {
[NFSPROC4_COMPOUND] = { [NFSPROC4_COMPOUND] = {
.pc_func = nfsd4_proc_compound, .pc_func = nfsd4_proc_compound,
.pc_decode = nfs4svc_decode_compoundargs, .pc_decode = nfs4svc_decode_compoundargs,
.pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, .pc_encode = nfs4svc_encode_compoundres,
.pc_argsize = sizeof(struct nfsd4_compoundargs), .pc_argsize = sizeof(struct nfsd4_compoundargs),
.pc_ressize = sizeof(struct nfsd4_compoundres), .pc_ressize = sizeof(struct nfsd4_compoundres),
.pc_release = nfsd4_release_compoundargs, .pc_release = nfsd4_release_compoundargs,
......
...@@ -4538,7 +4538,7 @@ nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op) ...@@ -4538,7 +4538,7 @@ nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op)
} }
int int
nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
...@@ -4584,11 +4584,12 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -4584,11 +4584,12 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p)
} }
int int
nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundres *resp) nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p)
{ {
/* /*
* All that remains is to write the tag and operation count... * All that remains is to write the tag and operation count...
*/ */
struct nfsd4_compoundres *resp = rqstp->rq_resp;
struct xdr_buf *buf = resp->xdr.buf; struct xdr_buf *buf = resp->xdr.buf;
WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len + WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
......
...@@ -577,7 +577,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -577,7 +577,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_NULL] = { [NFSPROC_NULL] = {
.pc_func = nfsd_proc_null, .pc_func = nfsd_proc_null,
.pc_decode = nfssvc_decode_void, .pc_decode = nfssvc_decode_void,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_void), .pc_argsize = sizeof(struct nfsd_void),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -586,7 +586,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -586,7 +586,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_GETATTR] = { [NFSPROC_GETATTR] = {
.pc_func = nfsd_proc_getattr, .pc_func = nfsd_proc_getattr,
.pc_decode = nfssvc_decode_fhandle, .pc_decode = nfssvc_decode_fhandle,
.pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, .pc_encode = nfssvc_encode_attrstat,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_fhandle), .pc_argsize = sizeof(struct nfsd_fhandle),
.pc_ressize = sizeof(struct nfsd_attrstat), .pc_ressize = sizeof(struct nfsd_attrstat),
...@@ -596,7 +596,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -596,7 +596,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_SETATTR] = { [NFSPROC_SETATTR] = {
.pc_func = nfsd_proc_setattr, .pc_func = nfsd_proc_setattr,
.pc_decode = nfssvc_decode_sattrargs, .pc_decode = nfssvc_decode_sattrargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, .pc_encode = nfssvc_encode_attrstat,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_sattrargs), .pc_argsize = sizeof(struct nfsd_sattrargs),
.pc_ressize = sizeof(struct nfsd_attrstat), .pc_ressize = sizeof(struct nfsd_attrstat),
...@@ -605,7 +605,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -605,7 +605,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
}, },
[NFSPROC_ROOT] = { [NFSPROC_ROOT] = {
.pc_decode = nfssvc_decode_void, .pc_decode = nfssvc_decode_void,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_void), .pc_argsize = sizeof(struct nfsd_void),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -614,7 +614,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -614,7 +614,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_LOOKUP] = { [NFSPROC_LOOKUP] = {
.pc_func = nfsd_proc_lookup, .pc_func = nfsd_proc_lookup,
.pc_decode = nfssvc_decode_diropargs, .pc_decode = nfssvc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_diropres, .pc_encode = nfssvc_encode_diropres,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_diropargs), .pc_argsize = sizeof(struct nfsd_diropargs),
.pc_ressize = sizeof(struct nfsd_diropres), .pc_ressize = sizeof(struct nfsd_diropres),
...@@ -624,7 +624,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -624,7 +624,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_READLINK] = { [NFSPROC_READLINK] = {
.pc_func = nfsd_proc_readlink, .pc_func = nfsd_proc_readlink,
.pc_decode = nfssvc_decode_readlinkargs, .pc_decode = nfssvc_decode_readlinkargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres, .pc_encode = nfssvc_encode_readlinkres,
.pc_argsize = sizeof(struct nfsd_readlinkargs), .pc_argsize = sizeof(struct nfsd_readlinkargs),
.pc_ressize = sizeof(struct nfsd_readlinkres), .pc_ressize = sizeof(struct nfsd_readlinkres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -633,7 +633,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -633,7 +633,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_READ] = { [NFSPROC_READ] = {
.pc_func = nfsd_proc_read, .pc_func = nfsd_proc_read,
.pc_decode = nfssvc_decode_readargs, .pc_decode = nfssvc_decode_readargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_readres, .pc_encode = nfssvc_encode_readres,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_readargs), .pc_argsize = sizeof(struct nfsd_readargs),
.pc_ressize = sizeof(struct nfsd_readres), .pc_ressize = sizeof(struct nfsd_readres),
...@@ -642,7 +642,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -642,7 +642,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
}, },
[NFSPROC_WRITECACHE] = { [NFSPROC_WRITECACHE] = {
.pc_decode = nfssvc_decode_void, .pc_decode = nfssvc_decode_void,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_void), .pc_argsize = sizeof(struct nfsd_void),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -651,7 +651,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -651,7 +651,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_WRITE] = { [NFSPROC_WRITE] = {
.pc_func = nfsd_proc_write, .pc_func = nfsd_proc_write,
.pc_decode = nfssvc_decode_writeargs, .pc_decode = nfssvc_decode_writeargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, .pc_encode = nfssvc_encode_attrstat,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_writeargs), .pc_argsize = sizeof(struct nfsd_writeargs),
.pc_ressize = sizeof(struct nfsd_attrstat), .pc_ressize = sizeof(struct nfsd_attrstat),
...@@ -661,7 +661,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -661,7 +661,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_CREATE] = { [NFSPROC_CREATE] = {
.pc_func = nfsd_proc_create, .pc_func = nfsd_proc_create,
.pc_decode = nfssvc_decode_createargs, .pc_decode = nfssvc_decode_createargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_diropres, .pc_encode = nfssvc_encode_diropres,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_createargs), .pc_argsize = sizeof(struct nfsd_createargs),
.pc_ressize = sizeof(struct nfsd_diropres), .pc_ressize = sizeof(struct nfsd_diropres),
...@@ -671,7 +671,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -671,7 +671,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_REMOVE] = { [NFSPROC_REMOVE] = {
.pc_func = nfsd_proc_remove, .pc_func = nfsd_proc_remove,
.pc_decode = nfssvc_decode_diropargs, .pc_decode = nfssvc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_diropargs), .pc_argsize = sizeof(struct nfsd_diropargs),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_REPLSTAT, .pc_cachetype = RC_REPLSTAT,
...@@ -680,7 +680,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -680,7 +680,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_RENAME] = { [NFSPROC_RENAME] = {
.pc_func = nfsd_proc_rename, .pc_func = nfsd_proc_rename,
.pc_decode = nfssvc_decode_renameargs, .pc_decode = nfssvc_decode_renameargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_renameargs), .pc_argsize = sizeof(struct nfsd_renameargs),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_REPLSTAT, .pc_cachetype = RC_REPLSTAT,
...@@ -689,7 +689,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -689,7 +689,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_LINK] = { [NFSPROC_LINK] = {
.pc_func = nfsd_proc_link, .pc_func = nfsd_proc_link,
.pc_decode = nfssvc_decode_linkargs, .pc_decode = nfssvc_decode_linkargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_linkargs), .pc_argsize = sizeof(struct nfsd_linkargs),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_REPLSTAT, .pc_cachetype = RC_REPLSTAT,
...@@ -698,7 +698,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -698,7 +698,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_SYMLINK] = { [NFSPROC_SYMLINK] = {
.pc_func = nfsd_proc_symlink, .pc_func = nfsd_proc_symlink,
.pc_decode = nfssvc_decode_symlinkargs, .pc_decode = nfssvc_decode_symlinkargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_symlinkargs), .pc_argsize = sizeof(struct nfsd_symlinkargs),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_REPLSTAT, .pc_cachetype = RC_REPLSTAT,
...@@ -707,7 +707,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -707,7 +707,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_MKDIR] = { [NFSPROC_MKDIR] = {
.pc_func = nfsd_proc_mkdir, .pc_func = nfsd_proc_mkdir,
.pc_decode = nfssvc_decode_createargs, .pc_decode = nfssvc_decode_createargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_diropres, .pc_encode = nfssvc_encode_diropres,
.pc_release = nfssvc_release_fhandle, .pc_release = nfssvc_release_fhandle,
.pc_argsize = sizeof(struct nfsd_createargs), .pc_argsize = sizeof(struct nfsd_createargs),
.pc_ressize = sizeof(struct nfsd_diropres), .pc_ressize = sizeof(struct nfsd_diropres),
...@@ -717,7 +717,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -717,7 +717,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_RMDIR] = { [NFSPROC_RMDIR] = {
.pc_func = nfsd_proc_rmdir, .pc_func = nfsd_proc_rmdir,
.pc_decode = nfssvc_decode_diropargs, .pc_decode = nfssvc_decode_diropargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_void, .pc_encode = nfssvc_encode_void,
.pc_argsize = sizeof(struct nfsd_diropargs), .pc_argsize = sizeof(struct nfsd_diropargs),
.pc_ressize = sizeof(struct nfsd_void), .pc_ressize = sizeof(struct nfsd_void),
.pc_cachetype = RC_REPLSTAT, .pc_cachetype = RC_REPLSTAT,
...@@ -726,7 +726,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -726,7 +726,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_READDIR] = { [NFSPROC_READDIR] = {
.pc_func = nfsd_proc_readdir, .pc_func = nfsd_proc_readdir,
.pc_decode = nfssvc_decode_readdirargs, .pc_decode = nfssvc_decode_readdirargs,
.pc_encode = (kxdrproc_t) nfssvc_encode_readdirres, .pc_encode = nfssvc_encode_readdirres,
.pc_argsize = sizeof(struct nfsd_readdirargs), .pc_argsize = sizeof(struct nfsd_readdirargs),
.pc_ressize = sizeof(struct nfsd_readdirres), .pc_ressize = sizeof(struct nfsd_readdirres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
...@@ -734,7 +734,7 @@ static struct svc_procedure nfsd_procedures2[18] = { ...@@ -734,7 +734,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
[NFSPROC_STATFS] = { [NFSPROC_STATFS] = {
.pc_func = nfsd_proc_statfs, .pc_func = nfsd_proc_statfs,
.pc_decode = nfssvc_decode_fhandle, .pc_decode = nfssvc_decode_fhandle,
.pc_encode = (kxdrproc_t) nfssvc_encode_statfsres, .pc_encode = nfssvc_encode_statfsres,
.pc_argsize = sizeof(struct nfsd_fhandle), .pc_argsize = sizeof(struct nfsd_fhandle),
.pc_ressize = sizeof(struct nfsd_statfsres), .pc_ressize = sizeof(struct nfsd_statfsres),
.pc_cachetype = RC_NOCACHE, .pc_cachetype = RC_NOCACHE,
......
...@@ -782,7 +782,6 @@ int ...@@ -782,7 +782,6 @@ int
nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
{ {
struct svc_procedure *proc; struct svc_procedure *proc;
kxdrproc_t xdr;
__be32 nfserr; __be32 nfserr;
__be32 *nfserrp; __be32 *nfserrp;
...@@ -841,9 +840,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) ...@@ -841,9 +840,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
* For NFSv2, additional info is never returned in case of an error. * For NFSv2, additional info is never returned in case of an error.
*/ */
if (!(nfserr && rqstp->rq_vers == 2)) { if (!(nfserr && rqstp->rq_vers == 2)) {
xdr = proc->pc_encode; if (proc->pc_encode && !proc->pc_encode(rqstp, nfserrp)) {
if (xdr && !xdr(rqstp, nfserrp,
rqstp->rq_resp)) {
/* Failed to encode result. Release cache entry */ /* Failed to encode result. Release cache entry */
dprintk("nfsd: failed to encode result!\n"); dprintk("nfsd: failed to encode result!\n");
nfsd_cache_update(rqstp, RC_NOCACHE, NULL); nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
......
...@@ -422,32 +422,35 @@ nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) ...@@ -422,32 +422,35 @@ nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
* XDR encode functions * XDR encode functions
*/ */
int int
nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
{ {
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
int int
nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_attrstat *resp)
{ {
struct nfsd_attrstat *resp = rqstp->rq_resp;
p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
int int
nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_diropres *resp)
{ {
struct nfsd_diropres *resp = rqstp->rq_resp;
p = encode_fh(p, &resp->fh); p = encode_fh(p, &resp->fh);
p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
return xdr_ressize_check(rqstp, p); return xdr_ressize_check(rqstp, p);
} }
int int
nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_readlinkres *resp)
{ {
struct nfsd_readlinkres *resp = rqstp->rq_resp;
*p++ = htonl(resp->len); *p++ = htonl(resp->len);
xdr_ressize_check(rqstp, p); xdr_ressize_check(rqstp, p);
rqstp->rq_res.page_len = resp->len; rqstp->rq_res.page_len = resp->len;
...@@ -461,9 +464,10 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, ...@@ -461,9 +464,10 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
} }
int int
nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_readres *resp)
{ {
struct nfsd_readres *resp = rqstp->rq_resp;
p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
*p++ = htonl(resp->count); *p++ = htonl(resp->count);
xdr_ressize_check(rqstp, p); xdr_ressize_check(rqstp, p);
...@@ -480,9 +484,10 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, ...@@ -480,9 +484,10 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
} }
int int
nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_readdirres *resp)
{ {
struct nfsd_readdirres *resp = rqstp->rq_resp;
xdr_ressize_check(rqstp, p); xdr_ressize_check(rqstp, p);
p = resp->buffer; p = resp->buffer;
*p++ = 0; /* no more entries */ *p++ = 0; /* no more entries */
...@@ -493,9 +498,9 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, ...@@ -493,9 +498,9 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p,
} }
int int
nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p, nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p)
struct nfsd_statfsres *resp)
{ {
struct nfsd_statfsres *resp = rqstp->rq_resp;
struct kstatfs *stat = &resp->stats; struct kstatfs *stat = &resp->stats;
*p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */ *p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */
......
...@@ -143,13 +143,13 @@ int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *); ...@@ -143,13 +143,13 @@ int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *);
int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *); int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *);
int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *); int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *);
int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *); int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *);
int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); int nfssvc_encode_void(struct svc_rqst *, __be32 *);
int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *);
int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); int nfssvc_encode_diropres(struct svc_rqst *, __be32 *);
int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *);
int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); int nfssvc_encode_readres(struct svc_rqst *, __be32 *);
int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *);
int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *);
int nfssvc_encode_entry(void *, const char *name, int nfssvc_encode_entry(void *, const char *name,
int namlen, loff_t offset, u64 ino, unsigned int); int namlen, loff_t offset, u64 ino, unsigned int);
......
...@@ -285,35 +285,22 @@ int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *); ...@@ -285,35 +285,22 @@ int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *);
int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *); int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *);
int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *); int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *);
int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *); int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *);
int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *);
struct nfsd3_attrstat *); int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *);
int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *);
struct nfsd3_attrstat *); int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *, int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *);
struct nfsd3_diropres *); int nfs3svc_encode_readres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *, int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *);
struct nfsd3_accessres *); int nfs3svc_encode_createres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *, int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *);
struct nfsd3_readlinkres *); int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *); int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *); int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_createres(struct svc_rqst *, __be32 *, int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *);
struct nfsd3_diropres *); int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *);
int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *, int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *);
struct nfsd3_renameres *);
int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *,
struct nfsd3_linkres *);
int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *,
struct nfsd3_readdirres *);
int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *,
struct nfsd3_fsstatres *);
int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *,
struct nfsd3_fsinfores *);
int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *,
struct nfsd3_pathconfres *);
int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *,
struct nfsd3_commitres *);
void nfs3svc_release_fhandle(struct svc_rqst *); void nfs3svc_release_fhandle(struct svc_rqst *);
void nfs3svc_release_fhandle2(struct svc_rqst *); void nfs3svc_release_fhandle2(struct svc_rqst *);
......
...@@ -682,10 +682,9 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) ...@@ -682,10 +682,9 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *);
int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *); int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *);
int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *);
struct nfsd4_compoundres *);
__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); __be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op); void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op);
......
...@@ -96,16 +96,16 @@ struct nlm_reboot { ...@@ -96,16 +96,16 @@ struct nlm_reboot {
#define NLMSVC_XDRSIZE sizeof(struct nlm_args) #define NLMSVC_XDRSIZE sizeof(struct nlm_args)
int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *); int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *);
int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); int nlmsvc_encode_testres(struct svc_rqst *, __be32 *);
int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *); int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *);
int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *); int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *);
int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *); int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *);
int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); int nlmsvc_encode_res(struct svc_rqst *, __be32 *);
int nlmsvc_decode_res(struct svc_rqst *, __be32 *); int nlmsvc_decode_res(struct svc_rqst *, __be32 *);
int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *); int nlmsvc_encode_void(struct svc_rqst *, __be32 *);
int nlmsvc_decode_void(struct svc_rqst *, __be32 *); int nlmsvc_decode_void(struct svc_rqst *, __be32 *);
int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *); int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *);
int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *);
int nlmsvc_decode_notify(struct svc_rqst *, __be32 *); int nlmsvc_decode_notify(struct svc_rqst *, __be32 *);
int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *); int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *);
/* /*
......
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *); int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *);
int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); int nlm4svc_encode_testres(struct svc_rqst *, __be32 *);
int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *); int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *);
int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *); int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *);
int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *); int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *);
int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); int nlm4svc_encode_res(struct svc_rqst *, __be32 *);
int nlm4svc_decode_res(struct svc_rqst *, __be32 *); int nlm4svc_decode_res(struct svc_rqst *, __be32 *);
int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *); int nlm4svc_encode_void(struct svc_rqst *, __be32 *);
int nlm4svc_decode_void(struct svc_rqst *, __be32 *); int nlm4svc_decode_void(struct svc_rqst *, __be32 *);
int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *); int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *);
int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *);
int nlm4svc_decode_notify(struct svc_rqst *, __be32 *); int nlm4svc_decode_notify(struct svc_rqst *, __be32 *);
int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *); int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *);
/* /*
......
...@@ -424,7 +424,8 @@ struct svc_procedure { ...@@ -424,7 +424,8 @@ struct svc_procedure {
__be32 (*pc_func)(struct svc_rqst *); __be32 (*pc_func)(struct svc_rqst *);
/* XDR decode args: */ /* XDR decode args: */
int (*pc_decode)(struct svc_rqst *, __be32 *data); int (*pc_decode)(struct svc_rqst *, __be32 *data);
kxdrproc_t pc_encode; /* XDR encode result */ /* XDR encode result: */
int (*pc_encode)(struct svc_rqst *, __be32 *data);
/* XDR free result: */ /* XDR free result: */
void (*pc_release)(struct svc_rqst *); void (*pc_release)(struct svc_rqst *);
unsigned int pc_argsize; /* argument struct size */ unsigned int pc_argsize; /* argument struct size */
......
...@@ -1154,7 +1154,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) ...@@ -1154,7 +1154,6 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
struct svc_version *versp = NULL; /* compiler food */ struct svc_version *versp = NULL; /* compiler food */
struct svc_procedure *procp = NULL; struct svc_procedure *procp = NULL;
struct svc_serv *serv = rqstp->rq_server; struct svc_serv *serv = rqstp->rq_server;
kxdrproc_t xdr;
__be32 *statp; __be32 *statp;
u32 prog, vers, proc; u32 prog, vers, proc;
__be32 auth_stat, rpc_stat; __be32 auth_stat, rpc_stat;
...@@ -1298,9 +1297,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) ...@@ -1298,9 +1297,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
procp->pc_release(rqstp); procp->pc_release(rqstp);
goto err_bad_auth; goto err_bad_auth;
} }
if (*statp == rpc_success && if (*statp == rpc_success && procp->pc_encode &&
(xdr = procp->pc_encode) && !procp->pc_encode(rqstp, resv->iov_base + resv->iov_len)) {
!xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) {
dprintk("svc: failed to encode reply\n"); dprintk("svc: failed to encode reply\n");
/* serv->sv_stats->rpcsystemerr++; */ /* serv->sv_stats->rpcsystemerr++; */
*statp = rpc_system_err; *statp = rpc_system_err;
......
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