summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-05-08 13:01:48 -0400
committerChristoph Hellwig <hch@lst.de>2017-05-15 11:42:24 -0400
commit026fec7e7c4723b5f26a753bbcad69f68c8299d4 (patch)
treeef9d60d345e80aa9823dfa3e2405e9ec09459d0d
parent8537488b5a2f33980e33f654b0a515304de2b267 (diff)
sunrpc: properly type pc_decode callbacks
Drop the argp 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: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/lockd/svc4proc.c2
-rw-r--r--fs/lockd/svcproc.c2
-rw-r--r--fs/lockd/xdr.c29
-rw-r--r--fs/lockd/xdr4.c29
-rw-r--r--fs/nfs/callback_xdr.c4
-rw-r--r--fs/nfsd/nfs2acl.c21
-rw-r--r--fs/nfsd/nfs3acl.c11
-rw-r--r--fs/nfsd/nfs3proc.c42
-rw-r--r--fs/nfsd/nfs3xdr.c74
-rw-r--r--fs/nfsd/nfs4proc.c2
-rw-r--r--fs/nfsd/nfs4xdr.c4
-rw-r--r--fs/nfsd/nfsproc.c36
-rw-r--r--fs/nfsd/nfssvc.c5
-rw-r--r--fs/nfsd/nfsxdr.c53
-rw-r--r--fs/nfsd/xdr.h34
-rw-r--r--fs/nfsd/xdr3.h47
-rw-r--r--fs/nfsd/xdr4.h3
-rw-r--r--include/linux/lockd/xdr.h18
-rw-r--r--include/linux/lockd/xdr4.h18
-rw-r--r--include/linux/sunrpc/svc.h3
-rw-r--r--net/sunrpc/svc.c9
21 files changed, 237 insertions, 209 deletions
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 3e4cba029d3d..804744f7528c 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -496,7 +496,7 @@ struct nlm_void { int dummy; };
496 496
497#define PROC(name, xargt, xrest, argt, rest, respsize) \ 497#define PROC(name, xargt, xrest, argt, rest, respsize) \
498 { .pc_func = nlm4svc_proc_##name, \ 498 { .pc_func = nlm4svc_proc_##name, \
499 .pc_decode = (kxdrproc_t) nlm4svc_decode_##xargt, \ 499 .pc_decode = nlm4svc_decode_##xargt, \
500 .pc_encode = (kxdrproc_t) nlm4svc_encode_##xrest, \ 500 .pc_encode = (kxdrproc_t) nlm4svc_encode_##xrest, \
501 .pc_release = NULL, \ 501 .pc_release = NULL, \
502 .pc_argsize = sizeof(struct nlm_##argt), \ 502 .pc_argsize = sizeof(struct nlm_##argt), \
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 3add50661fab..204a698f7d41 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -538,7 +538,7 @@ struct nlm_void { int dummy; };
538 538
539#define PROC(name, xargt, xrest, argt, rest, respsize) \ 539#define PROC(name, xargt, xrest, argt, rest, respsize) \
540 { .pc_func = nlmsvc_proc_##name, \ 540 { .pc_func = nlmsvc_proc_##name, \
541 .pc_decode = (kxdrproc_t) nlmsvc_decode_##xargt, \ 541 .pc_decode = nlmsvc_decode_##xargt, \
542 .pc_encode = (kxdrproc_t) nlmsvc_encode_##xrest, \ 542 .pc_encode = (kxdrproc_t) nlmsvc_encode_##xrest, \
543 .pc_release = NULL, \ 543 .pc_release = NULL, \
544 .pc_argsize = sizeof(struct nlm_##argt), \ 544 .pc_argsize = sizeof(struct nlm_##argt), \
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 5b651daad518..b57af63fba56 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -182,8 +182,9 @@ nlm_encode_testres(__be32 *p, struct nlm_res *resp)
182 * First, the server side XDR functions 182 * First, the server side XDR functions
183 */ 183 */
184int 184int
185nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 185nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
186{ 186{
187 struct nlm_args *argp = rqstp->rq_argp;
187 u32 exclusive; 188 u32 exclusive;
188 189
189 if (!(p = nlm_decode_cookie(p, &argp->cookie))) 190 if (!(p = nlm_decode_cookie(p, &argp->cookie)))
@@ -207,8 +208,9 @@ nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
207} 208}
208 209
209int 210int
210nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 211nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p)
211{ 212{
213 struct nlm_args *argp = rqstp->rq_argp;
212 u32 exclusive; 214 u32 exclusive;
213 215
214 if (!(p = nlm_decode_cookie(p, &argp->cookie))) 216 if (!(p = nlm_decode_cookie(p, &argp->cookie)))
@@ -227,8 +229,9 @@ nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
227} 229}
228 230
229int 231int
230nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 232nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p)
231{ 233{
234 struct nlm_args *argp = rqstp->rq_argp;
232 u32 exclusive; 235 u32 exclusive;
233 236
234 if (!(p = nlm_decode_cookie(p, &argp->cookie))) 237 if (!(p = nlm_decode_cookie(p, &argp->cookie)))
@@ -243,8 +246,10 @@ nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
243} 246}
244 247
245int 248int
246nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 249nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p)
247{ 250{
251 struct nlm_args *argp = rqstp->rq_argp;
252
248 if (!(p = nlm_decode_cookie(p, &argp->cookie)) 253 if (!(p = nlm_decode_cookie(p, &argp->cookie))
249 || !(p = nlm_decode_lock(p, &argp->lock))) 254 || !(p = nlm_decode_lock(p, &argp->lock)))
250 return 0; 255 return 0;
@@ -253,8 +258,9 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
253} 258}
254 259
255int 260int
256nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 261nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
257{ 262{
263 struct nlm_args *argp = rqstp->rq_argp;
258 struct nlm_lock *lock = &argp->lock; 264 struct nlm_lock *lock = &argp->lock;
259 265
260 memset(lock, 0, sizeof(*lock)); 266 memset(lock, 0, sizeof(*lock));
@@ -293,8 +299,9 @@ nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
293} 299}
294 300
295int 301int
296nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp) 302nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
297{ 303{
304 struct nlm_args *argp = rqstp->rq_argp;
298 struct nlm_lock *lock = &argp->lock; 305 struct nlm_lock *lock = &argp->lock;
299 306
300 if (!(p = xdr_decode_string_inplace(p, &lock->caller, 307 if (!(p = xdr_decode_string_inplace(p, &lock->caller,
@@ -305,8 +312,10 @@ nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
305} 312}
306 313
307int 314int
308nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp) 315nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p)
309{ 316{
317 struct nlm_reboot *argp = rqstp->rq_argp;
318
310 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) 319 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
311 return 0; 320 return 0;
312 argp->state = ntohl(*p++); 321 argp->state = ntohl(*p++);
@@ -316,8 +325,10 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp)
316} 325}
317 326
318int 327int
319nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 328nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p)
320{ 329{
330 struct nlm_res *resp = rqstp->rq_argp;
331
321 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 332 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
322 return 0; 333 return 0;
323 resp->status = *p++; 334 resp->status = *p++;
@@ -325,7 +336,7 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
325} 336}
326 337
327int 338int
328nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 339nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p)
329{ 340{
330 return xdr_argsize_check(rqstp, p); 341 return xdr_argsize_check(rqstp, p);
331} 342}
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index dfa4789cd460..46e18598a15c 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -179,8 +179,9 @@ nlm4_encode_testres(__be32 *p, struct nlm_res *resp)
179 * First, the server side XDR functions 179 * First, the server side XDR functions
180 */ 180 */
181int 181int
182nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 182nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
183{ 183{
184 struct nlm_args *argp = rqstp->rq_argp;
184 u32 exclusive; 185 u32 exclusive;
185 186
186 if (!(p = nlm4_decode_cookie(p, &argp->cookie))) 187 if (!(p = nlm4_decode_cookie(p, &argp->cookie)))
@@ -204,8 +205,9 @@ nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
204} 205}
205 206
206int 207int
207nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 208nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p)
208{ 209{
210 struct nlm_args *argp = rqstp->rq_argp;
209 u32 exclusive; 211 u32 exclusive;
210 212
211 if (!(p = nlm4_decode_cookie(p, &argp->cookie))) 213 if (!(p = nlm4_decode_cookie(p, &argp->cookie)))
@@ -224,8 +226,9 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
224} 226}
225 227
226int 228int
227nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 229nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p)
228{ 230{
231 struct nlm_args *argp = rqstp->rq_argp;
229 u32 exclusive; 232 u32 exclusive;
230 233
231 if (!(p = nlm4_decode_cookie(p, &argp->cookie))) 234 if (!(p = nlm4_decode_cookie(p, &argp->cookie)))
@@ -240,8 +243,10 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
240} 243}
241 244
242int 245int
243nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 246nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p)
244{ 247{
248 struct nlm_args *argp = rqstp->rq_argp;
249
245 if (!(p = nlm4_decode_cookie(p, &argp->cookie)) 250 if (!(p = nlm4_decode_cookie(p, &argp->cookie))
246 || !(p = nlm4_decode_lock(p, &argp->lock))) 251 || !(p = nlm4_decode_lock(p, &argp->lock)))
247 return 0; 252 return 0;
@@ -250,8 +255,9 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
250} 255}
251 256
252int 257int
253nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp) 258nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
254{ 259{
260 struct nlm_args *argp = rqstp->rq_argp;
255 struct nlm_lock *lock = &argp->lock; 261 struct nlm_lock *lock = &argp->lock;
256 262
257 memset(lock, 0, sizeof(*lock)); 263 memset(lock, 0, sizeof(*lock));
@@ -290,8 +296,9 @@ nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
290} 296}
291 297
292int 298int
293nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp) 299nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p)
294{ 300{
301 struct nlm_args *argp = rqstp->rq_argp;
295 struct nlm_lock *lock = &argp->lock; 302 struct nlm_lock *lock = &argp->lock;
296 303
297 if (!(p = xdr_decode_string_inplace(p, &lock->caller, 304 if (!(p = xdr_decode_string_inplace(p, &lock->caller,
@@ -302,8 +309,10 @@ nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
302} 309}
303 310
304int 311int
305nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp) 312nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p)
306{ 313{
314 struct nlm_reboot *argp = rqstp->rq_argp;
315
307 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) 316 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
308 return 0; 317 return 0;
309 argp->state = ntohl(*p++); 318 argp->state = ntohl(*p++);
@@ -313,8 +322,10 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp
313} 322}
314 323
315int 324int
316nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 325nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p)
317{ 326{
327 struct nlm_res *resp = rqstp->rq_argp;
328
318 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 329 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
319 return 0; 330 return 0;
320 resp->status = *p++; 331 resp->status = *p++;
@@ -322,7 +333,7 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
322} 333}
323 334
324int 335int
325nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 336nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p)
326{ 337{
327 return xdr_argsize_check(rqstp, p); 338 return xdr_argsize_check(rqstp, p);
328} 339}
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 5a14bdaa5986..23ecbf7a40c1 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -58,7 +58,7 @@ static __be32 nfs4_callback_null(struct svc_rqst *rqstp)
58 return htonl(NFS4_OK); 58 return htonl(NFS4_OK);
59} 59}
60 60
61static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 61static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p)
62{ 62{
63 return xdr_argsize_check(rqstp, p); 63 return xdr_argsize_check(rqstp, p);
64} 64}
@@ -998,7 +998,7 @@ static struct callback_op callback_ops[] = {
998static struct svc_procedure nfs4_callback_procedures1[] = { 998static struct svc_procedure nfs4_callback_procedures1[] = {
999 [CB_NULL] = { 999 [CB_NULL] = {
1000 .pc_func = nfs4_callback_null, 1000 .pc_func = nfs4_callback_null,
1001 .pc_decode = (kxdrproc_t)nfs4_decode_void, 1001 .pc_decode = nfs4_decode_void,
1002 .pc_encode = (kxdrproc_t)nfs4_encode_void, 1002 .pc_encode = (kxdrproc_t)nfs4_encode_void,
1003 .pc_xdrressize = 1, 1003 .pc_xdrressize = 1,
1004 }, 1004 },
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 302441027f50..bcfdaa83ee6c 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -182,9 +182,10 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp)
182/* 182/*
183 * XDR decode functions 183 * XDR decode functions
184 */ 184 */
185static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p, 185static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
186 struct nfsd3_getaclargs *argp)
187{ 186{
187 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
188
188 p = nfs2svc_decode_fh(p, &argp->fh); 189 p = nfs2svc_decode_fh(p, &argp->fh);
189 if (!p) 190 if (!p)
190 return 0; 191 return 0;
@@ -194,9 +195,9 @@ static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
194} 195}
195 196
196 197
197static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p, 198static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
198 struct nfsd3_setaclargs *argp)
199{ 199{
200 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
200 struct kvec *head = rqstp->rq_arg.head; 201 struct kvec *head = rqstp->rq_arg.head;
201 unsigned int base; 202 unsigned int base;
202 int n; 203 int n;
@@ -220,18 +221,20 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
220 return (n > 0); 221 return (n > 0);
221} 222}
222 223
223static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p, 224static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p)
224 struct nfsd_fhandle *argp)
225{ 225{
226 struct nfsd_fhandle *argp = rqstp->rq_argp;
227
226 p = nfs2svc_decode_fh(p, &argp->fh); 228 p = nfs2svc_decode_fh(p, &argp->fh);
227 if (!p) 229 if (!p)
228 return 0; 230 return 0;
229 return xdr_argsize_check(rqstp, p); 231 return xdr_argsize_check(rqstp, p);
230} 232}
231 233
232static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p, 234static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
233 struct nfsd3_accessargs *argp)
234{ 235{
236 struct nfsd3_accessargs *argp = rqstp->rq_argp;
237
235 p = nfs2svc_decode_fh(p, &argp->fh); 238 p = nfs2svc_decode_fh(p, &argp->fh);
236 if (!p) 239 if (!p)
237 return 0; 240 return 0;
@@ -351,7 +354,7 @@ struct nfsd3_voidargs { int dummy; };
351#define PROC(name, argt, rest, relt, cache, respsize) \ 354#define PROC(name, argt, rest, relt, cache, respsize) \
352{ \ 355{ \
353 .pc_func = nfsacld_proc_##name, \ 356 .pc_func = nfsacld_proc_##name, \
354 .pc_decode = (kxdrproc_t) nfsaclsvc_decode_##argt##args, \ 357 .pc_decode = nfsaclsvc_decode_##argt##args, \
355 .pc_encode = (kxdrproc_t) nfsaclsvc_encode_##rest##res, \ 358 .pc_encode = (kxdrproc_t) nfsaclsvc_encode_##rest##res, \
356 .pc_release = nfsaclsvc_release_##relt, \ 359 .pc_release = nfsaclsvc_release_##relt, \
357 .pc_argsize = sizeof(struct nfsd3_##argt##args), \ 360 .pc_argsize = sizeof(struct nfsd3_##argt##args), \
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index 56cdff4e954c..4e68d6b5f409 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -124,9 +124,10 @@ out:
124/* 124/*
125 * XDR decode functions 125 * XDR decode functions
126 */ 126 */
127static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p, 127static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
128 struct nfsd3_getaclargs *args)
129{ 128{
129 struct nfsd3_getaclargs *args = rqstp->rq_argp;
130
130 p = nfs3svc_decode_fh(p, &args->fh); 131 p = nfs3svc_decode_fh(p, &args->fh);
131 if (!p) 132 if (!p)
132 return 0; 133 return 0;
@@ -136,9 +137,9 @@ static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
136} 137}
137 138
138 139
139static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p, 140static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
140 struct nfsd3_setaclargs *args)
141{ 141{
142 struct nfsd3_setaclargs *args = rqstp->rq_argp;
142 struct kvec *head = rqstp->rq_arg.head; 143 struct kvec *head = rqstp->rq_arg.head;
143 unsigned int base; 144 unsigned int base;
144 int n; 145 int n;
@@ -241,7 +242,7 @@ struct nfsd3_voidargs { int dummy; };
241#define PROC(name, argt, rest, relt, cache, respsize) \ 242#define PROC(name, argt, rest, relt, cache, respsize) \
242{ \ 243{ \
243 .pc_func = nfsd3_proc_##name, \ 244 .pc_func = nfsd3_proc_##name, \
244 .pc_decode = (kxdrproc_t) nfs3svc_decode_##argt##args, \ 245 .pc_decode = nfs3svc_decode_##argt##args, \
245 .pc_encode = (kxdrproc_t) nfs3svc_encode_##rest##res, \ 246 .pc_encode = (kxdrproc_t) nfs3svc_encode_##rest##res, \
246 .pc_release = nfs3svc_release_##relt, \ 247 .pc_release = nfs3svc_release_##relt, \
247 .pc_argsize = sizeof(struct nfsd3_##argt##args), \ 248 .pc_argsize = sizeof(struct nfsd3_##argt##args), \
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index f0cccc0768ce..ed83e8a9e7b4 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -685,7 +685,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
685 }, 685 },
686 [NFS3PROC_GETATTR] = { 686 [NFS3PROC_GETATTR] = {
687 .pc_func = nfsd3_proc_getattr, 687 .pc_func = nfsd3_proc_getattr,
688 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 688 .pc_decode = nfs3svc_decode_fhandleargs,
689 .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres, 689 .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres,
690 .pc_release = nfs3svc_release_fhandle, 690 .pc_release = nfs3svc_release_fhandle,
691 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 691 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
@@ -695,7 +695,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
695 }, 695 },
696 [NFS3PROC_SETATTR] = { 696 [NFS3PROC_SETATTR] = {
697 .pc_func = nfsd3_proc_setattr, 697 .pc_func = nfsd3_proc_setattr,
698 .pc_decode = (kxdrproc_t) nfs3svc_decode_sattrargs, 698 .pc_decode = nfs3svc_decode_sattrargs,
699 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 699 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
700 .pc_release = nfs3svc_release_fhandle, 700 .pc_release = nfs3svc_release_fhandle,
701 .pc_argsize = sizeof(struct nfsd3_sattrargs), 701 .pc_argsize = sizeof(struct nfsd3_sattrargs),
@@ -705,7 +705,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
705 }, 705 },
706 [NFS3PROC_LOOKUP] = { 706 [NFS3PROC_LOOKUP] = {
707 .pc_func = nfsd3_proc_lookup, 707 .pc_func = nfsd3_proc_lookup,
708 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 708 .pc_decode = nfs3svc_decode_diropargs,
709 .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres, 709 .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres,
710 .pc_release = nfs3svc_release_fhandle2, 710 .pc_release = nfs3svc_release_fhandle2,
711 .pc_argsize = sizeof(struct nfsd3_diropargs), 711 .pc_argsize = sizeof(struct nfsd3_diropargs),
@@ -715,7 +715,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
715 }, 715 },
716 [NFS3PROC_ACCESS] = { 716 [NFS3PROC_ACCESS] = {
717 .pc_func = nfsd3_proc_access, 717 .pc_func = nfsd3_proc_access,
718 .pc_decode = (kxdrproc_t) nfs3svc_decode_accessargs, 718 .pc_decode = nfs3svc_decode_accessargs,
719 .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres, 719 .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres,
720 .pc_release = nfs3svc_release_fhandle, 720 .pc_release = nfs3svc_release_fhandle,
721 .pc_argsize = sizeof(struct nfsd3_accessargs), 721 .pc_argsize = sizeof(struct nfsd3_accessargs),
@@ -725,7 +725,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
725 }, 725 },
726 [NFS3PROC_READLINK] = { 726 [NFS3PROC_READLINK] = {
727 .pc_func = nfsd3_proc_readlink, 727 .pc_func = nfsd3_proc_readlink,
728 .pc_decode = (kxdrproc_t) nfs3svc_decode_readlinkargs, 728 .pc_decode = nfs3svc_decode_readlinkargs,
729 .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres, 729 .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres,
730 .pc_release = nfs3svc_release_fhandle, 730 .pc_release = nfs3svc_release_fhandle,
731 .pc_argsize = sizeof(struct nfsd3_readlinkargs), 731 .pc_argsize = sizeof(struct nfsd3_readlinkargs),
@@ -735,7 +735,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
735 }, 735 },
736 [NFS3PROC_READ] = { 736 [NFS3PROC_READ] = {
737 .pc_func = nfsd3_proc_read, 737 .pc_func = nfsd3_proc_read,
738 .pc_decode = (kxdrproc_t) nfs3svc_decode_readargs, 738 .pc_decode = nfs3svc_decode_readargs,
739 .pc_encode = (kxdrproc_t) nfs3svc_encode_readres, 739 .pc_encode = (kxdrproc_t) nfs3svc_encode_readres,
740 .pc_release = nfs3svc_release_fhandle, 740 .pc_release = nfs3svc_release_fhandle,
741 .pc_argsize = sizeof(struct nfsd3_readargs), 741 .pc_argsize = sizeof(struct nfsd3_readargs),
@@ -745,7 +745,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
745 }, 745 },
746 [NFS3PROC_WRITE] = { 746 [NFS3PROC_WRITE] = {
747 .pc_func = nfsd3_proc_write, 747 .pc_func = nfsd3_proc_write,
748 .pc_decode = (kxdrproc_t) nfs3svc_decode_writeargs, 748 .pc_decode = nfs3svc_decode_writeargs,
749 .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres, 749 .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres,
750 .pc_release = nfs3svc_release_fhandle, 750 .pc_release = nfs3svc_release_fhandle,
751 .pc_argsize = sizeof(struct nfsd3_writeargs), 751 .pc_argsize = sizeof(struct nfsd3_writeargs),
@@ -755,7 +755,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
755 }, 755 },
756 [NFS3PROC_CREATE] = { 756 [NFS3PROC_CREATE] = {
757 .pc_func = nfsd3_proc_create, 757 .pc_func = nfsd3_proc_create,
758 .pc_decode = (kxdrproc_t) nfs3svc_decode_createargs, 758 .pc_decode = nfs3svc_decode_createargs,
759 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 759 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
760 .pc_release = nfs3svc_release_fhandle2, 760 .pc_release = nfs3svc_release_fhandle2,
761 .pc_argsize = sizeof(struct nfsd3_createargs), 761 .pc_argsize = sizeof(struct nfsd3_createargs),
@@ -765,7 +765,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
765 }, 765 },
766 [NFS3PROC_MKDIR] = { 766 [NFS3PROC_MKDIR] = {
767 .pc_func = nfsd3_proc_mkdir, 767 .pc_func = nfsd3_proc_mkdir,
768 .pc_decode = (kxdrproc_t) nfs3svc_decode_mkdirargs, 768 .pc_decode = nfs3svc_decode_mkdirargs,
769 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 769 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
770 .pc_release = nfs3svc_release_fhandle2, 770 .pc_release = nfs3svc_release_fhandle2,
771 .pc_argsize = sizeof(struct nfsd3_mkdirargs), 771 .pc_argsize = sizeof(struct nfsd3_mkdirargs),
@@ -775,7 +775,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
775 }, 775 },
776 [NFS3PROC_SYMLINK] = { 776 [NFS3PROC_SYMLINK] = {
777 .pc_func = nfsd3_proc_symlink, 777 .pc_func = nfsd3_proc_symlink,
778 .pc_decode = (kxdrproc_t) nfs3svc_decode_symlinkargs, 778 .pc_decode = nfs3svc_decode_symlinkargs,
779 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 779 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
780 .pc_release = nfs3svc_release_fhandle2, 780 .pc_release = nfs3svc_release_fhandle2,
781 .pc_argsize = sizeof(struct nfsd3_symlinkargs), 781 .pc_argsize = sizeof(struct nfsd3_symlinkargs),
@@ -785,7 +785,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
785 }, 785 },
786 [NFS3PROC_MKNOD] = { 786 [NFS3PROC_MKNOD] = {
787 .pc_func = nfsd3_proc_mknod, 787 .pc_func = nfsd3_proc_mknod,
788 .pc_decode = (kxdrproc_t) nfs3svc_decode_mknodargs, 788 .pc_decode = nfs3svc_decode_mknodargs,
789 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 789 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
790 .pc_release = nfs3svc_release_fhandle2, 790 .pc_release = nfs3svc_release_fhandle2,
791 .pc_argsize = sizeof(struct nfsd3_mknodargs), 791 .pc_argsize = sizeof(struct nfsd3_mknodargs),
@@ -795,7 +795,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
795 }, 795 },
796 [NFS3PROC_REMOVE] = { 796 [NFS3PROC_REMOVE] = {
797 .pc_func = nfsd3_proc_remove, 797 .pc_func = nfsd3_proc_remove,
798 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 798 .pc_decode = nfs3svc_decode_diropargs,
799 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 799 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
800 .pc_release = nfs3svc_release_fhandle, 800 .pc_release = nfs3svc_release_fhandle,
801 .pc_argsize = sizeof(struct nfsd3_diropargs), 801 .pc_argsize = sizeof(struct nfsd3_diropargs),
@@ -805,7 +805,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
805 }, 805 },
806 [NFS3PROC_RMDIR] = { 806 [NFS3PROC_RMDIR] = {
807 .pc_func = nfsd3_proc_rmdir, 807 .pc_func = nfsd3_proc_rmdir,
808 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 808 .pc_decode = nfs3svc_decode_diropargs,
809 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 809 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
810 .pc_release = nfs3svc_release_fhandle, 810 .pc_release = nfs3svc_release_fhandle,
811 .pc_argsize = sizeof(struct nfsd3_diropargs), 811 .pc_argsize = sizeof(struct nfsd3_diropargs),
@@ -815,7 +815,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
815 }, 815 },
816 [NFS3PROC_RENAME] = { 816 [NFS3PROC_RENAME] = {
817 .pc_func = nfsd3_proc_rename, 817 .pc_func = nfsd3_proc_rename,
818 .pc_decode = (kxdrproc_t) nfs3svc_decode_renameargs, 818 .pc_decode = nfs3svc_decode_renameargs,
819 .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres, 819 .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres,
820 .pc_release = nfs3svc_release_fhandle2, 820 .pc_release = nfs3svc_release_fhandle2,
821 .pc_argsize = sizeof(struct nfsd3_renameargs), 821 .pc_argsize = sizeof(struct nfsd3_renameargs),
@@ -825,7 +825,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
825 }, 825 },
826 [NFS3PROC_LINK] = { 826 [NFS3PROC_LINK] = {
827 .pc_func = nfsd3_proc_link, 827 .pc_func = nfsd3_proc_link,
828 .pc_decode = (kxdrproc_t) nfs3svc_decode_linkargs, 828 .pc_decode = nfs3svc_decode_linkargs,
829 .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres, 829 .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres,
830 .pc_release = nfs3svc_release_fhandle2, 830 .pc_release = nfs3svc_release_fhandle2,
831 .pc_argsize = sizeof(struct nfsd3_linkargs), 831 .pc_argsize = sizeof(struct nfsd3_linkargs),
@@ -835,7 +835,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
835 }, 835 },
836 [NFS3PROC_READDIR] = { 836 [NFS3PROC_READDIR] = {
837 .pc_func = nfsd3_proc_readdir, 837 .pc_func = nfsd3_proc_readdir,
838 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirargs, 838 .pc_decode = nfs3svc_decode_readdirargs,
839 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 839 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
840 .pc_release = nfs3svc_release_fhandle, 840 .pc_release = nfs3svc_release_fhandle,
841 .pc_argsize = sizeof(struct nfsd3_readdirargs), 841 .pc_argsize = sizeof(struct nfsd3_readdirargs),
@@ -844,7 +844,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
844 }, 844 },
845 [NFS3PROC_READDIRPLUS] = { 845 [NFS3PROC_READDIRPLUS] = {
846 .pc_func = nfsd3_proc_readdirplus, 846 .pc_func = nfsd3_proc_readdirplus,
847 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirplusargs, 847 .pc_decode = nfs3svc_decode_readdirplusargs,
848 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 848 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
849 .pc_release = nfs3svc_release_fhandle, 849 .pc_release = nfs3svc_release_fhandle,
850 .pc_argsize = sizeof(struct nfsd3_readdirplusargs), 850 .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
@@ -853,7 +853,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
853 }, 853 },
854 [NFS3PROC_FSSTAT] = { 854 [NFS3PROC_FSSTAT] = {
855 .pc_func = nfsd3_proc_fsstat, 855 .pc_func = nfsd3_proc_fsstat,
856 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 856 .pc_decode = nfs3svc_decode_fhandleargs,
857 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres, 857 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres,
858 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 858 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
859 .pc_ressize = sizeof(struct nfsd3_fsstatres), 859 .pc_ressize = sizeof(struct nfsd3_fsstatres),
@@ -862,7 +862,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
862 }, 862 },
863 [NFS3PROC_FSINFO] = { 863 [NFS3PROC_FSINFO] = {
864 .pc_func = nfsd3_proc_fsinfo, 864 .pc_func = nfsd3_proc_fsinfo,
865 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 865 .pc_decode = nfs3svc_decode_fhandleargs,
866 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores, 866 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores,
867 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 867 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
868 .pc_ressize = sizeof(struct nfsd3_fsinfores), 868 .pc_ressize = sizeof(struct nfsd3_fsinfores),
@@ -871,7 +871,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
871 }, 871 },
872 [NFS3PROC_PATHCONF] = { 872 [NFS3PROC_PATHCONF] = {
873 .pc_func = nfsd3_proc_pathconf, 873 .pc_func = nfsd3_proc_pathconf,
874 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 874 .pc_decode = nfs3svc_decode_fhandleargs,
875 .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres, 875 .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres,
876 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 876 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
877 .pc_ressize = sizeof(struct nfsd3_pathconfres), 877 .pc_ressize = sizeof(struct nfsd3_pathconfres),
@@ -880,7 +880,7 @@ static struct svc_procedure nfsd_procedures3[22] = {
880 }, 880 },
881 [NFS3PROC_COMMIT] = { 881 [NFS3PROC_COMMIT] = {
882 .pc_func = nfsd3_proc_commit, 882 .pc_func = nfsd3_proc_commit,
883 .pc_decode = (kxdrproc_t) nfs3svc_decode_commitargs, 883 .pc_decode = nfs3svc_decode_commitargs,
884 .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres, 884 .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres,
885 .pc_release = nfs3svc_release_fhandle, 885 .pc_release = nfs3svc_release_fhandle,
886 .pc_argsize = sizeof(struct nfsd3_commitargs), 886 .pc_argsize = sizeof(struct nfsd3_commitargs),
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 7fd361a75287..be8bf8af9917 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -273,8 +273,10 @@ void fill_post_wcc(struct svc_fh *fhp)
273 * XDR decode functions 273 * XDR decode functions
274 */ 274 */
275int 275int
276nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args) 276nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p)
277{ 277{
278 struct nfsd_fhandle *args = rqstp->rq_argp;
279
278 p = decode_fh(p, &args->fh); 280 p = decode_fh(p, &args->fh);
279 if (!p) 281 if (!p)
280 return 0; 282 return 0;
@@ -282,9 +284,10 @@ nfs3svc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *a
282} 284}
283 285
284int 286int
285nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p, 287nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p)
286 struct nfsd3_sattrargs *args)
287{ 288{
289 struct nfsd3_sattrargs *args = rqstp->rq_argp;
290
288 p = decode_fh(p, &args->fh); 291 p = decode_fh(p, &args->fh);
289 if (!p) 292 if (!p)
290 return 0; 293 return 0;
@@ -300,9 +303,10 @@ nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p,
300} 303}
301 304
302int 305int
303nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p, 306nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p)
304 struct nfsd3_diropargs *args)
305{ 307{
308 struct nfsd3_diropargs *args = rqstp->rq_argp;
309
306 if (!(p = decode_fh(p, &args->fh)) 310 if (!(p = decode_fh(p, &args->fh))
307 || !(p = decode_filename(p, &args->name, &args->len))) 311 || !(p = decode_filename(p, &args->name, &args->len)))
308 return 0; 312 return 0;
@@ -311,9 +315,10 @@ nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p,
311} 315}
312 316
313int 317int
314nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p, 318nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
315 struct nfsd3_accessargs *args)
316{ 319{
320 struct nfsd3_accessargs *args = rqstp->rq_argp;
321
317 p = decode_fh(p, &args->fh); 322 p = decode_fh(p, &args->fh);
318 if (!p) 323 if (!p)
319 return 0; 324 return 0;
@@ -323,9 +328,9 @@ nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
323} 328}
324 329
325int 330int
326nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p, 331nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p)
327 struct nfsd3_readargs *args)
328{ 332{
333 struct nfsd3_readargs *args = rqstp->rq_argp;
329 unsigned int len; 334 unsigned int len;
330 int v; 335 int v;
331 u32 max_blocksize = svc_max_payload(rqstp); 336 u32 max_blocksize = svc_max_payload(rqstp);
@@ -356,9 +361,9 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
356} 361}
357 362
358int 363int
359nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, 364nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
360 struct nfsd3_writeargs *args)
361{ 365{
366 struct nfsd3_writeargs *args = rqstp->rq_argp;
362 unsigned int len, v, hdr, dlen; 367 unsigned int len, v, hdr, dlen;
363 u32 max_blocksize = svc_max_payload(rqstp); 368 u32 max_blocksize = svc_max_payload(rqstp);
364 struct kvec *head = rqstp->rq_arg.head; 369 struct kvec *head = rqstp->rq_arg.head;
@@ -416,9 +421,10 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
416} 421}
417 422
418int 423int
419nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, 424nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p)
420 struct nfsd3_createargs *args)
421{ 425{
426 struct nfsd3_createargs *args = rqstp->rq_argp;
427
422 if (!(p = decode_fh(p, &args->fh)) 428 if (!(p = decode_fh(p, &args->fh))
423 || !(p = decode_filename(p, &args->name, &args->len))) 429 || !(p = decode_filename(p, &args->name, &args->len)))
424 return 0; 430 return 0;
@@ -438,10 +444,12 @@ nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
438 444
439 return xdr_argsize_check(rqstp, p); 445 return xdr_argsize_check(rqstp, p);
440} 446}
447
441int 448int
442nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p, 449nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p)
443 struct nfsd3_createargs *args)
444{ 450{
451 struct nfsd3_createargs *args = rqstp->rq_argp;
452
445 if (!(p = decode_fh(p, &args->fh)) || 453 if (!(p = decode_fh(p, &args->fh)) ||
446 !(p = decode_filename(p, &args->name, &args->len))) 454 !(p = decode_filename(p, &args->name, &args->len)))
447 return 0; 455 return 0;
@@ -451,9 +459,9 @@ nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p,
451} 459}
452 460
453int 461int
454nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, 462nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
455 struct nfsd3_symlinkargs *args)
456{ 463{
464 struct nfsd3_symlinkargs *args = rqstp->rq_argp;
457 unsigned int len, avail; 465 unsigned int len, avail;
458 char *old, *new; 466 char *old, *new;
459 struct kvec *vec; 467 struct kvec *vec;
@@ -503,9 +511,10 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
503} 511}
504 512
505int 513int
506nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p, 514nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p)
507 struct nfsd3_mknodargs *args)
508{ 515{
516 struct nfsd3_mknodargs *args = rqstp->rq_argp;
517
509 if (!(p = decode_fh(p, &args->fh)) 518 if (!(p = decode_fh(p, &args->fh))
510 || !(p = decode_filename(p, &args->name, &args->len))) 519 || !(p = decode_filename(p, &args->name, &args->len)))
511 return 0; 520 return 0;
@@ -525,9 +534,10 @@ nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p,
525} 534}
526 535
527int 536int
528nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, 537nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p)
529 struct nfsd3_renameargs *args)
530{ 538{
539 struct nfsd3_renameargs *args = rqstp->rq_argp;
540
531 if (!(p = decode_fh(p, &args->ffh)) 541 if (!(p = decode_fh(p, &args->ffh))
532 || !(p = decode_filename(p, &args->fname, &args->flen)) 542 || !(p = decode_filename(p, &args->fname, &args->flen))
533 || !(p = decode_fh(p, &args->tfh)) 543 || !(p = decode_fh(p, &args->tfh))
@@ -538,9 +548,10 @@ nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
538} 548}
539 549
540int 550int
541nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, 551nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p)
542 struct nfsd3_readlinkargs *args)
543{ 552{
553 struct nfsd3_readlinkargs *args = rqstp->rq_argp;
554
544 p = decode_fh(p, &args->fh); 555 p = decode_fh(p, &args->fh);
545 if (!p) 556 if (!p)
546 return 0; 557 return 0;
@@ -552,9 +563,10 @@ nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
552} 563}
553 564
554int 565int
555nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, 566nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p)
556 struct nfsd3_linkargs *args)
557{ 567{
568 struct nfsd3_linkargs *args = rqstp->rq_argp;
569
558 if (!(p = decode_fh(p, &args->ffh)) 570 if (!(p = decode_fh(p, &args->ffh))
559 || !(p = decode_fh(p, &args->tfh)) 571 || !(p = decode_fh(p, &args->tfh))
560 || !(p = decode_filename(p, &args->tname, &args->tlen))) 572 || !(p = decode_filename(p, &args->tname, &args->tlen)))
@@ -564,9 +576,9 @@ nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
564} 576}
565 577
566int 578int
567nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, 579nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
568 struct nfsd3_readdirargs *args)
569{ 580{
581 struct nfsd3_readdirargs *args = rqstp->rq_argp;
570 p = decode_fh(p, &args->fh); 582 p = decode_fh(p, &args->fh);
571 if (!p) 583 if (!p)
572 return 0; 584 return 0;
@@ -585,9 +597,9 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
585} 597}
586 598
587int 599int
588nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p, 600nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p)
589 struct nfsd3_readdirargs *args)
590{ 601{
602 struct nfsd3_readdirargs *args = rqstp->rq_argp;
591 int len; 603 int len;
592 u32 max_blocksize = svc_max_payload(rqstp); 604 u32 max_blocksize = svc_max_payload(rqstp);
593 605
@@ -613,9 +625,9 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p,
613} 625}
614 626
615int 627int
616nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p, 628nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p)
617 struct nfsd3_commitargs *args)
618{ 629{
630 struct nfsd3_commitargs *args = rqstp->rq_argp;
619 p = decode_fh(p, &args->fh); 631 p = decode_fh(p, &args->fh);
620 if (!p) 632 if (!p)
621 return 0; 633 return 0;
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 7a0112bc3531..6ff434b77a9e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -2528,7 +2528,7 @@ static struct svc_procedure nfsd_procedures4[2] = {
2528 }, 2528 },
2529 [NFSPROC4_COMPOUND] = { 2529 [NFSPROC4_COMPOUND] = {
2530 .pc_func = nfsd4_proc_compound, 2530 .pc_func = nfsd4_proc_compound,
2531 .pc_decode = (kxdrproc_t) nfs4svc_decode_compoundargs, 2531 .pc_decode = nfs4svc_decode_compoundargs,
2532 .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, 2532 .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres,
2533 .pc_argsize = sizeof(struct nfsd4_compoundargs), 2533 .pc_argsize = sizeof(struct nfsd4_compoundargs),
2534 .pc_ressize = sizeof(struct nfsd4_compoundres), 2534 .pc_ressize = sizeof(struct nfsd4_compoundres),
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 5aa847bdfc63..3a7e117bd11e 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -4561,8 +4561,10 @@ void nfsd4_release_compoundargs(struct svc_rqst *rqstp)
4561} 4561}
4562 4562
4563int 4563int
4564nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args) 4564nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p)
4565{ 4565{
4566 struct nfsd4_compoundargs *args = rqstp->rq_argp;
4567
4566 if (rqstp->rq_arg.head[0].iov_len % 4) { 4568 if (rqstp->rq_arg.head[0].iov_len % 4) {
4567 /* client is nuts */ 4569 /* client is nuts */
4568 dprintk("%s: compound not properly padded! (peeraddr=%pISc xid=0x%x)", 4570 dprintk("%s: compound not properly padded! (peeraddr=%pISc xid=0x%x)",
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index dc32e0f8480d..d351d0ef6d34 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -576,7 +576,7 @@ struct nfsd_void { int dummy; };
576static struct svc_procedure nfsd_procedures2[18] = { 576static struct svc_procedure nfsd_procedures2[18] = {
577 [NFSPROC_NULL] = { 577 [NFSPROC_NULL] = {
578 .pc_func = nfsd_proc_null, 578 .pc_func = nfsd_proc_null,
579 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 579 .pc_decode = nfssvc_decode_void,
580 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 580 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
581 .pc_argsize = sizeof(struct nfsd_void), 581 .pc_argsize = sizeof(struct nfsd_void),
582 .pc_ressize = sizeof(struct nfsd_void), 582 .pc_ressize = sizeof(struct nfsd_void),
@@ -585,7 +585,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
585 }, 585 },
586 [NFSPROC_GETATTR] = { 586 [NFSPROC_GETATTR] = {
587 .pc_func = nfsd_proc_getattr, 587 .pc_func = nfsd_proc_getattr,
588 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle, 588 .pc_decode = nfssvc_decode_fhandle,
589 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 589 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
590 .pc_release = nfssvc_release_fhandle, 590 .pc_release = nfssvc_release_fhandle,
591 .pc_argsize = sizeof(struct nfsd_fhandle), 591 .pc_argsize = sizeof(struct nfsd_fhandle),
@@ -595,7 +595,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
595 }, 595 },
596 [NFSPROC_SETATTR] = { 596 [NFSPROC_SETATTR] = {
597 .pc_func = nfsd_proc_setattr, 597 .pc_func = nfsd_proc_setattr,
598 .pc_decode = (kxdrproc_t) nfssvc_decode_sattrargs, 598 .pc_decode = nfssvc_decode_sattrargs,
599 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 599 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
600 .pc_release = nfssvc_release_fhandle, 600 .pc_release = nfssvc_release_fhandle,
601 .pc_argsize = sizeof(struct nfsd_sattrargs), 601 .pc_argsize = sizeof(struct nfsd_sattrargs),
@@ -604,7 +604,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
604 .pc_xdrressize = ST+AT, 604 .pc_xdrressize = ST+AT,
605 }, 605 },
606 [NFSPROC_ROOT] = { 606 [NFSPROC_ROOT] = {
607 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 607 .pc_decode = nfssvc_decode_void,
608 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 608 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
609 .pc_argsize = sizeof(struct nfsd_void), 609 .pc_argsize = sizeof(struct nfsd_void),
610 .pc_ressize = sizeof(struct nfsd_void), 610 .pc_ressize = sizeof(struct nfsd_void),
@@ -613,7 +613,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
613 }, 613 },
614 [NFSPROC_LOOKUP] = { 614 [NFSPROC_LOOKUP] = {
615 .pc_func = nfsd_proc_lookup, 615 .pc_func = nfsd_proc_lookup,
616 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 616 .pc_decode = nfssvc_decode_diropargs,
617 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 617 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
618 .pc_release = nfssvc_release_fhandle, 618 .pc_release = nfssvc_release_fhandle,
619 .pc_argsize = sizeof(struct nfsd_diropargs), 619 .pc_argsize = sizeof(struct nfsd_diropargs),
@@ -623,7 +623,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
623 }, 623 },
624 [NFSPROC_READLINK] = { 624 [NFSPROC_READLINK] = {
625 .pc_func = nfsd_proc_readlink, 625 .pc_func = nfsd_proc_readlink,
626 .pc_decode = (kxdrproc_t) nfssvc_decode_readlinkargs, 626 .pc_decode = nfssvc_decode_readlinkargs,
627 .pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres, 627 .pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres,
628 .pc_argsize = sizeof(struct nfsd_readlinkargs), 628 .pc_argsize = sizeof(struct nfsd_readlinkargs),
629 .pc_ressize = sizeof(struct nfsd_readlinkres), 629 .pc_ressize = sizeof(struct nfsd_readlinkres),
@@ -632,7 +632,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
632 }, 632 },
633 [NFSPROC_READ] = { 633 [NFSPROC_READ] = {
634 .pc_func = nfsd_proc_read, 634 .pc_func = nfsd_proc_read,
635 .pc_decode = (kxdrproc_t) nfssvc_decode_readargs, 635 .pc_decode = nfssvc_decode_readargs,
636 .pc_encode = (kxdrproc_t) nfssvc_encode_readres, 636 .pc_encode = (kxdrproc_t) nfssvc_encode_readres,
637 .pc_release = nfssvc_release_fhandle, 637 .pc_release = nfssvc_release_fhandle,
638 .pc_argsize = sizeof(struct nfsd_readargs), 638 .pc_argsize = sizeof(struct nfsd_readargs),
@@ -641,7 +641,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
641 .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4, 641 .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4,
642 }, 642 },
643 [NFSPROC_WRITECACHE] = { 643 [NFSPROC_WRITECACHE] = {
644 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 644 .pc_decode = nfssvc_decode_void,
645 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 645 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
646 .pc_argsize = sizeof(struct nfsd_void), 646 .pc_argsize = sizeof(struct nfsd_void),
647 .pc_ressize = sizeof(struct nfsd_void), 647 .pc_ressize = sizeof(struct nfsd_void),
@@ -650,7 +650,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
650 }, 650 },
651 [NFSPROC_WRITE] = { 651 [NFSPROC_WRITE] = {
652 .pc_func = nfsd_proc_write, 652 .pc_func = nfsd_proc_write,
653 .pc_decode = (kxdrproc_t) nfssvc_decode_writeargs, 653 .pc_decode = nfssvc_decode_writeargs,
654 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 654 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
655 .pc_release = nfssvc_release_fhandle, 655 .pc_release = nfssvc_release_fhandle,
656 .pc_argsize = sizeof(struct nfsd_writeargs), 656 .pc_argsize = sizeof(struct nfsd_writeargs),
@@ -660,7 +660,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
660 }, 660 },
661 [NFSPROC_CREATE] = { 661 [NFSPROC_CREATE] = {
662 .pc_func = nfsd_proc_create, 662 .pc_func = nfsd_proc_create,
663 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs, 663 .pc_decode = nfssvc_decode_createargs,
664 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 664 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
665 .pc_release = nfssvc_release_fhandle, 665 .pc_release = nfssvc_release_fhandle,
666 .pc_argsize = sizeof(struct nfsd_createargs), 666 .pc_argsize = sizeof(struct nfsd_createargs),
@@ -670,7 +670,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
670 }, 670 },
671 [NFSPROC_REMOVE] = { 671 [NFSPROC_REMOVE] = {
672 .pc_func = nfsd_proc_remove, 672 .pc_func = nfsd_proc_remove,
673 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 673 .pc_decode = nfssvc_decode_diropargs,
674 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 674 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
675 .pc_argsize = sizeof(struct nfsd_diropargs), 675 .pc_argsize = sizeof(struct nfsd_diropargs),
676 .pc_ressize = sizeof(struct nfsd_void), 676 .pc_ressize = sizeof(struct nfsd_void),
@@ -679,7 +679,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
679 }, 679 },
680 [NFSPROC_RENAME] = { 680 [NFSPROC_RENAME] = {
681 .pc_func = nfsd_proc_rename, 681 .pc_func = nfsd_proc_rename,
682 .pc_decode = (kxdrproc_t) nfssvc_decode_renameargs, 682 .pc_decode = nfssvc_decode_renameargs,
683 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 683 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
684 .pc_argsize = sizeof(struct nfsd_renameargs), 684 .pc_argsize = sizeof(struct nfsd_renameargs),
685 .pc_ressize = sizeof(struct nfsd_void), 685 .pc_ressize = sizeof(struct nfsd_void),
@@ -688,7 +688,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
688 }, 688 },
689 [NFSPROC_LINK] = { 689 [NFSPROC_LINK] = {
690 .pc_func = nfsd_proc_link, 690 .pc_func = nfsd_proc_link,
691 .pc_decode = (kxdrproc_t) nfssvc_decode_linkargs, 691 .pc_decode = nfssvc_decode_linkargs,
692 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 692 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
693 .pc_argsize = sizeof(struct nfsd_linkargs), 693 .pc_argsize = sizeof(struct nfsd_linkargs),
694 .pc_ressize = sizeof(struct nfsd_void), 694 .pc_ressize = sizeof(struct nfsd_void),
@@ -697,7 +697,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
697 }, 697 },
698 [NFSPROC_SYMLINK] = { 698 [NFSPROC_SYMLINK] = {
699 .pc_func = nfsd_proc_symlink, 699 .pc_func = nfsd_proc_symlink,
700 .pc_decode = (kxdrproc_t) nfssvc_decode_symlinkargs, 700 .pc_decode = nfssvc_decode_symlinkargs,
701 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 701 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
702 .pc_argsize = sizeof(struct nfsd_symlinkargs), 702 .pc_argsize = sizeof(struct nfsd_symlinkargs),
703 .pc_ressize = sizeof(struct nfsd_void), 703 .pc_ressize = sizeof(struct nfsd_void),
@@ -706,7 +706,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
706 }, 706 },
707 [NFSPROC_MKDIR] = { 707 [NFSPROC_MKDIR] = {
708 .pc_func = nfsd_proc_mkdir, 708 .pc_func = nfsd_proc_mkdir,
709 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs, 709 .pc_decode = nfssvc_decode_createargs,
710 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 710 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
711 .pc_release = nfssvc_release_fhandle, 711 .pc_release = nfssvc_release_fhandle,
712 .pc_argsize = sizeof(struct nfsd_createargs), 712 .pc_argsize = sizeof(struct nfsd_createargs),
@@ -716,7 +716,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
716 }, 716 },
717 [NFSPROC_RMDIR] = { 717 [NFSPROC_RMDIR] = {
718 .pc_func = nfsd_proc_rmdir, 718 .pc_func = nfsd_proc_rmdir,
719 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 719 .pc_decode = nfssvc_decode_diropargs,
720 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 720 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
721 .pc_argsize = sizeof(struct nfsd_diropargs), 721 .pc_argsize = sizeof(struct nfsd_diropargs),
722 .pc_ressize = sizeof(struct nfsd_void), 722 .pc_ressize = sizeof(struct nfsd_void),
@@ -725,7 +725,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
725 }, 725 },
726 [NFSPROC_READDIR] = { 726 [NFSPROC_READDIR] = {
727 .pc_func = nfsd_proc_readdir, 727 .pc_func = nfsd_proc_readdir,
728 .pc_decode = (kxdrproc_t) nfssvc_decode_readdirargs, 728 .pc_decode = nfssvc_decode_readdirargs,
729 .pc_encode = (kxdrproc_t) nfssvc_encode_readdirres, 729 .pc_encode = (kxdrproc_t) nfssvc_encode_readdirres,
730 .pc_argsize = sizeof(struct nfsd_readdirargs), 730 .pc_argsize = sizeof(struct nfsd_readdirargs),
731 .pc_ressize = sizeof(struct nfsd_readdirres), 731 .pc_ressize = sizeof(struct nfsd_readdirres),
@@ -733,7 +733,7 @@ static struct svc_procedure nfsd_procedures2[18] = {
733 }, 733 },
734 [NFSPROC_STATFS] = { 734 [NFSPROC_STATFS] = {
735 .pc_func = nfsd_proc_statfs, 735 .pc_func = nfsd_proc_statfs,
736 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle, 736 .pc_decode = nfssvc_decode_fhandle,
737 .pc_encode = (kxdrproc_t) nfssvc_encode_statfsres, 737 .pc_encode = (kxdrproc_t) nfssvc_encode_statfsres,
738 .pc_argsize = sizeof(struct nfsd_fhandle), 738 .pc_argsize = sizeof(struct nfsd_fhandle),
739 .pc_ressize = sizeof(struct nfsd_statfsres), 739 .pc_ressize = sizeof(struct nfsd_statfsres),
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index d64895fd8d25..3e00499d7ad7 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -801,9 +801,8 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
801 */ 801 */
802 rqstp->rq_cachetype = proc->pc_cachetype; 802 rqstp->rq_cachetype = proc->pc_cachetype;
803 /* Decode arguments */ 803 /* Decode arguments */
804 xdr = proc->pc_decode; 804 if (proc->pc_decode &&
805 if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base, 805 !proc->pc_decode(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base)) {
806 rqstp->rq_argp)) {
807 dprintk("nfsd: failed to decode arguments!\n"); 806 dprintk("nfsd: failed to decode arguments!\n");
808 *statp = rpc_garbage_args; 807 *statp = rpc_garbage_args;
809 return 1; 808 return 1;
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index de7b07ee489e..0957ceebe1aa 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -206,14 +206,16 @@ __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *f
206 * XDR decode functions 206 * XDR decode functions
207 */ 207 */
208int 208int
209nfssvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 209nfssvc_decode_void(struct svc_rqst *rqstp, __be32 *p)
210{ 210{
211 return xdr_argsize_check(rqstp, p); 211 return xdr_argsize_check(rqstp, p);
212} 212}
213 213
214int 214int
215nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *args) 215nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p)
216{ 216{
217 struct nfsd_fhandle *args = rqstp->rq_argp;
218
217 p = decode_fh(p, &args->fh); 219 p = decode_fh(p, &args->fh);
218 if (!p) 220 if (!p)
219 return 0; 221 return 0;
@@ -221,9 +223,10 @@ nfssvc_decode_fhandle(struct svc_rqst *rqstp, __be32 *p, struct nfsd_fhandle *ar
221} 223}
222 224
223int 225int
224nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p, 226nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p)
225 struct nfsd_sattrargs *args)
226{ 227{
228 struct nfsd_sattrargs *args = rqstp->rq_argp;
229
227 p = decode_fh(p, &args->fh); 230 p = decode_fh(p, &args->fh);
228 if (!p) 231 if (!p)
229 return 0; 232 return 0;
@@ -233,9 +236,10 @@ nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p,
233} 236}
234 237
235int 238int
236nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p, 239nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p)
237 struct nfsd_diropargs *args)
238{ 240{
241 struct nfsd_diropargs *args = rqstp->rq_argp;
242
239 if (!(p = decode_fh(p, &args->fh)) 243 if (!(p = decode_fh(p, &args->fh))
240 || !(p = decode_filename(p, &args->name, &args->len))) 244 || !(p = decode_filename(p, &args->name, &args->len)))
241 return 0; 245 return 0;
@@ -244,9 +248,9 @@ nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p,
244} 248}
245 249
246int 250int
247nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p, 251nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p)
248 struct nfsd_readargs *args)
249{ 252{
253 struct nfsd_readargs *args = rqstp->rq_argp;
250 unsigned int len; 254 unsigned int len;
251 int v; 255 int v;
252 p = decode_fh(p, &args->fh); 256 p = decode_fh(p, &args->fh);
@@ -279,9 +283,9 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
279} 283}
280 284
281int 285int
282nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, 286nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
283 struct nfsd_writeargs *args)
284{ 287{
288 struct nfsd_writeargs *args = rqstp->rq_argp;
285 unsigned int len, hdr, dlen; 289 unsigned int len, hdr, dlen;
286 struct kvec *head = rqstp->rq_arg.head; 290 struct kvec *head = rqstp->rq_arg.head;
287 int v; 291 int v;
@@ -335,9 +339,10 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
335} 339}
336 340
337int 341int
338nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, 342nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p)
339 struct nfsd_createargs *args)
340{ 343{
344 struct nfsd_createargs *args = rqstp->rq_argp;
345
341 if ( !(p = decode_fh(p, &args->fh)) 346 if ( !(p = decode_fh(p, &args->fh))
342 || !(p = decode_filename(p, &args->name, &args->len))) 347 || !(p = decode_filename(p, &args->name, &args->len)))
343 return 0; 348 return 0;
@@ -347,9 +352,10 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
347} 352}
348 353
349int 354int
350nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, 355nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p)
351 struct nfsd_renameargs *args)
352{ 356{
357 struct nfsd_renameargs *args = rqstp->rq_argp;
358
353 if (!(p = decode_fh(p, &args->ffh)) 359 if (!(p = decode_fh(p, &args->ffh))
354 || !(p = decode_filename(p, &args->fname, &args->flen)) 360 || !(p = decode_filename(p, &args->fname, &args->flen))
355 || !(p = decode_fh(p, &args->tfh)) 361 || !(p = decode_fh(p, &args->tfh))
@@ -360,8 +366,10 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
360} 366}
361 367
362int 368int
363nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readlinkargs *args) 369nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p)
364{ 370{
371 struct nfsd_readlinkargs *args = rqstp->rq_argp;
372
365 p = decode_fh(p, &args->fh); 373 p = decode_fh(p, &args->fh);
366 if (!p) 374 if (!p)
367 return 0; 375 return 0;
@@ -373,9 +381,10 @@ nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readli
373} 381}
374 382
375int 383int
376nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, 384nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p)
377 struct nfsd_linkargs *args)
378{ 385{
386 struct nfsd_linkargs *args = rqstp->rq_argp;
387
379 if (!(p = decode_fh(p, &args->ffh)) 388 if (!(p = decode_fh(p, &args->ffh))
380 || !(p = decode_fh(p, &args->tfh)) 389 || !(p = decode_fh(p, &args->tfh))
381 || !(p = decode_filename(p, &args->tname, &args->tlen))) 390 || !(p = decode_filename(p, &args->tname, &args->tlen)))
@@ -385,9 +394,10 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
385} 394}
386 395
387int 396int
388nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, 397nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
389 struct nfsd_symlinkargs *args)
390{ 398{
399 struct nfsd_symlinkargs *args = rqstp->rq_argp;
400
391 if ( !(p = decode_fh(p, &args->ffh)) 401 if ( !(p = decode_fh(p, &args->ffh))
392 || !(p = decode_filename(p, &args->fname, &args->flen)) 402 || !(p = decode_filename(p, &args->fname, &args->flen))
393 || !(p = decode_pathname(p, &args->tname, &args->tlen))) 403 || !(p = decode_pathname(p, &args->tname, &args->tlen)))
@@ -398,9 +408,10 @@ nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
398} 408}
399 409
400int 410int
401nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, 411nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
402 struct nfsd_readdirargs *args)
403{ 412{
413 struct nfsd_readdirargs *args = rqstp->rq_argp;
414
404 p = decode_fh(p, &args->fh); 415 p = decode_fh(p, &args->fh);
405 if (!p) 416 if (!p)
406 return 0; 417 return 0;
diff --git a/fs/nfsd/xdr.h b/fs/nfsd/xdr.h
index 2c21fa843fbf..8eeb752cf6f8 100644
--- a/fs/nfsd/xdr.h
+++ b/fs/nfsd/xdr.h
@@ -131,28 +131,18 @@ union nfsd_xdrstore {
131#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) 131#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
132 132
133 133
134int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *); 134int nfssvc_decode_void(struct svc_rqst *, __be32 *);
135int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); 135int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *);
136int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *, 136int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *);
137 struct nfsd_sattrargs *); 137int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *);
138int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *, 138int nfssvc_decode_readargs(struct svc_rqst *, __be32 *);
139 struct nfsd_diropargs *); 139int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *);
140int nfssvc_decode_readargs(struct svc_rqst *, __be32 *, 140int nfssvc_decode_createargs(struct svc_rqst *, __be32 *);
141 struct nfsd_readargs *); 141int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *);
142int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *, 142int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *);
143 struct nfsd_writeargs *); 143int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *);
144int nfssvc_decode_createargs(struct svc_rqst *, __be32 *, 144int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *);
145 struct nfsd_createargs *); 145int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *);
146int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *,
147 struct nfsd_renameargs *);
148int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *,
149 struct nfsd_readlinkargs *);
150int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *,
151 struct nfsd_linkargs *);
152int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *,
153 struct nfsd_symlinkargs *);
154int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *,
155 struct nfsd_readdirargs *);
156int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); 146int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *);
157int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); 147int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *);
158int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); 148int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *);
diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h
index 23fe456a223b..f79be4c42e4a 100644
--- a/fs/nfsd/xdr3.h
+++ b/fs/nfsd/xdr3.h
@@ -269,37 +269,22 @@ union nfsd3_xdrstore {
269 269
270#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) 270#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
271 271
272int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); 272int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *);
273int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *, 273int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *);
274 struct nfsd3_sattrargs *); 274int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *);
275int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *, 275int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *);
276 struct nfsd3_diropargs *); 276int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *);
277int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *, 277int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *);
278 struct nfsd3_accessargs *); 278int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *);
279int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *, 279int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *);
280 struct nfsd3_readargs *); 280int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *);
281int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *, 281int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *);
282 struct nfsd3_writeargs *); 282int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *);
283int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *, 283int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *);
284 struct nfsd3_createargs *); 284int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *);
285int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *, 285int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *);
286 struct nfsd3_createargs *); 286int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *);
287int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *, 287int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *);
288 struct nfsd3_mknodargs *);
289int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *,
290 struct nfsd3_renameargs *);
291int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *,
292 struct nfsd3_readlinkargs *);
293int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *,
294 struct nfsd3_linkargs *);
295int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *,
296 struct nfsd3_symlinkargs *);
297int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *,
298 struct nfsd3_readdirargs *);
299int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *,
300 struct nfsd3_readdirargs *);
301int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *,
302 struct nfsd3_commitargs *);
303int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 288int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
304int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, 289int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *,
305 struct nfsd3_attrstat *); 290 struct nfsd3_attrstat *);
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index a158579d55a2..2a53c1233884 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -683,8 +683,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
683 683
684bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); 684bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
685int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 685int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
686int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, 686int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *);
687 struct nfsd4_compoundargs *);
688int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, 687int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
689 struct nfsd4_compoundres *); 688 struct nfsd4_compoundres *);
690__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); 689__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index d39ed1cc5fbf..0416600844ce 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -95,19 +95,19 @@ struct nlm_reboot {
95 */ 95 */
96#define NLMSVC_XDRSIZE sizeof(struct nlm_args) 96#define NLMSVC_XDRSIZE sizeof(struct nlm_args)
97 97
98int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *); 98int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *);
99int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); 99int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
100int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *); 100int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *);
101int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *); 101int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *);
102int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *); 102int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *);
103int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 103int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
104int nlmsvc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 104int nlmsvc_decode_res(struct svc_rqst *, __be32 *);
105int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *); 105int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *);
106int nlmsvc_decode_void(struct svc_rqst *, __be32 *, void *); 106int nlmsvc_decode_void(struct svc_rqst *, __be32 *);
107int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *); 107int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *);
108int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); 108int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
109int nlmsvc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *); 109int nlmsvc_decode_notify(struct svc_rqst *, __be32 *);
110int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *); 110int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *);
111/* 111/*
112int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); 112int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
113int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 113int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index e58c88b52ce1..951bbe31fdb8 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -23,19 +23,19 @@
23 23
24 24
25 25
26int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *); 26int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *);
27int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); 27int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
28int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *); 28int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *);
29int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *); 29int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *);
30int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *); 30int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *);
31int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 31int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
32int nlm4svc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 32int nlm4svc_decode_res(struct svc_rqst *, __be32 *);
33int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *); 33int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *);
34int nlm4svc_decode_void(struct svc_rqst *, __be32 *, void *); 34int nlm4svc_decode_void(struct svc_rqst *, __be32 *);
35int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *); 35int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *);
36int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); 36int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
37int nlm4svc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *); 37int nlm4svc_decode_notify(struct svc_rqst *, __be32 *);
38int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *); 38int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *);
39/* 39/*
40int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); 40int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
41int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 41int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 1381e1343640..047f04411dd4 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -421,7 +421,8 @@ struct svc_version {
421struct svc_procedure { 421struct svc_procedure {
422 /* process the request: */ 422 /* process the request: */
423 __be32 (*pc_func)(struct svc_rqst *); 423 __be32 (*pc_func)(struct svc_rqst *);
424 kxdrproc_t pc_decode; /* XDR decode args */ 424 /* XDR decode args: */
425 int (*pc_decode)(struct svc_rqst *, __be32 *data);
425 kxdrproc_t pc_encode; /* XDR encode result */ 426 kxdrproc_t pc_encode; /* XDR encode result */
426 /* XDR free result: */ 427 /* XDR free result: */
427 void (*pc_release)(struct svc_rqst *); 428 void (*pc_release)(struct svc_rqst *);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 4611cb7adc04..18024c1b9b7b 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1276,9 +1276,12 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1276 1276
1277 /* Call the function that processes the request. */ 1277 /* Call the function that processes the request. */
1278 if (!versp->vs_dispatch) { 1278 if (!versp->vs_dispatch) {
1279 /* Decode arguments */ 1279 /*
1280 xdr = procp->pc_decode; 1280 * Decode arguments
1281 if (xdr && !xdr(rqstp, argv->iov_base, rqstp->rq_argp)) 1281 * XXX: why do we ignore the return value?
1282 */
1283 if (procp->pc_decode &&
1284 !procp->pc_decode(rqstp, argv->iov_base))
1282 goto err_garbage; 1285 goto err_garbage;
1283 1286
1284 *statp = procp->pc_func(rqstp); 1287 *statp = procp->pc_func(rqstp);