summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-13 16:56:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-13 16:56:24 -0400
commit62403005975c678ba7594a36670ae3bf0273d7c4 (patch)
tree10113ca849639a544c2b356dddf99712d40e99dd /fs/nfsd
parent19c6e12c07ceab2ff5d5ec97354b893ab386c41c (diff)
parentb20dae70bfa5014fdf201d0a8589271b888e4927 (diff)
Merge tag 'nfsd-4.13' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields: "Chuck's RDMA update overhauls the "call receive" side of the RPC-over-RDMA transport to use the new rdma_rw API. Christoph cleaned the way nfs operations are declared, removing a bunch of function-pointer casts and declaring the operation vectors as const. Christoph's changes touch both client and server, and both client and server pulls this time around should be based on the same commits from Christoph" * tag 'nfsd-4.13' of git://linux-nfs.org/~bfields/linux: (53 commits) svcrdma: fix an incorrect check on -E2BIG and -EINVAL nfsd4: factor ctime into change attribute svcrdma: Remove svc_rdma_chunk_ctxt::cc_dir field svcrdma: use offset_in_page() macro svcrdma: Clean up after converting svc_rdma_recvfrom to rdma_rw API svcrdma: Clean-up svc_rdma_unmap_dma svcrdma: Remove frmr cache svcrdma: Remove unused Read completion handlers svcrdma: Properly compute .len and .buflen for received RPC Calls svcrdma: Use generic RDMA R/W API in RPC Call path svcrdma: Add recvfrom helpers to svc_rdma_rw.c sunrpc: Allocate up to RPCSVC_MAXPAGES per svc_rqst svcrdma: Don't account for Receive queue "starvation" svcrdma: Improve Reply chunk sanity checking svcrdma: Improve Write chunk sanity checking svcrdma: Improve Read chunk sanity checking svcrdma: Remove svc_rdma_marshal.c svcrdma: Avoid Send Queue overflow svcrdma: Squelch disconnection messages sunrpc: Disable splice for krb5i ...
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/current_stateid.h36
-rw-r--r--fs/nfsd/nfs2acl.c116
-rw-r--r--fs/nfsd/nfs3acl.c75
-rw-r--r--fs/nfsd/nfs3proc.c301
-rw-r--r--fs/nfsd/nfs3xdr.c166
-rw-r--r--fs/nfsd/nfs4callback.c32
-rw-r--r--fs/nfsd/nfs4proc.c412
-rw-r--r--fs/nfsd/nfs4state.c142
-rw-r--r--fs/nfsd/nfs4xdr.c15
-rw-r--r--fs/nfsd/nfsd.h6
-rw-r--r--fs/nfsd/nfsfh.h24
-rw-r--r--fs/nfsd/nfsproc.c206
-rw-r--r--fs/nfsd/nfssvc.c24
-rw-r--r--fs/nfsd/nfsxdr.c92
-rw-r--r--fs/nfsd/xdr.h50
-rw-r--r--fs/nfsd/xdr3.h100
-rw-r--r--fs/nfsd/xdr4.h78
17 files changed, 999 insertions, 876 deletions
diff --git a/fs/nfsd/current_stateid.h b/fs/nfsd/current_stateid.h
index 4123551208d8..34075cee573a 100644
--- a/fs/nfsd/current_stateid.h
+++ b/fs/nfsd/current_stateid.h
@@ -8,21 +8,33 @@ extern void clear_current_stateid(struct nfsd4_compound_state *cstate);
8/* 8/*
9 * functions to set current state id 9 * functions to set current state id
10 */ 10 */
11extern void nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *); 11extern void nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *,
12extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); 12 union nfsd4_op_u *);
13extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *); 13extern void nfsd4_set_openstateid(struct nfsd4_compound_state *,
14extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); 14 union nfsd4_op_u *);
15extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *,
16 union nfsd4_op_u *);
17extern void nfsd4_set_closestateid(struct nfsd4_compound_state *,
18 union nfsd4_op_u *);
15 19
16/* 20/*
17 * functions to consume current state id 21 * functions to consume current state id
18 */ 22 */
19extern void nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *); 23extern void nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *,
20extern void nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *, struct nfsd4_delegreturn *); 24 union nfsd4_op_u *);
21extern void nfsd4_get_freestateid(struct nfsd4_compound_state *, struct nfsd4_free_stateid *); 25extern void nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *,
22extern void nfsd4_get_setattrstateid(struct nfsd4_compound_state *, struct nfsd4_setattr *); 26 union nfsd4_op_u *);
23extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); 27extern void nfsd4_get_freestateid(struct nfsd4_compound_state *,
24extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *, struct nfsd4_locku *); 28 union nfsd4_op_u *);
25extern void nfsd4_get_readstateid(struct nfsd4_compound_state *, struct nfsd4_read *); 29extern void nfsd4_get_setattrstateid(struct nfsd4_compound_state *,
26extern void nfsd4_get_writestateid(struct nfsd4_compound_state *, struct nfsd4_write *); 30 union nfsd4_op_u *);
31extern void nfsd4_get_closestateid(struct nfsd4_compound_state *,
32 union nfsd4_op_u *);
33extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *,
34 union nfsd4_op_u *);
35extern void nfsd4_get_readstateid(struct nfsd4_compound_state *,
36 union nfsd4_op_u *);
37extern void nfsd4_get_writestateid(struct nfsd4_compound_state *,
38 union nfsd4_op_u *);
27 39
28#endif /* _NFSD4_CURRENT_STATE_H */ 40#endif /* _NFSD4_CURRENT_STATE_H */
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 838f90f3f890..6276ec8608b0 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -19,7 +19,7 @@
19 * NULL call. 19 * NULL call.
20 */ 20 */
21static __be32 21static __be32
22nfsacld_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) 22nfsacld_proc_null(struct svc_rqst *rqstp)
23{ 23{
24 return nfs_ok; 24 return nfs_ok;
25} 25}
@@ -27,9 +27,10 @@ nfsacld_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
27/* 27/*
28 * Get the Access and/or Default ACL of a file. 28 * Get the Access and/or Default ACL of a file.
29 */ 29 */
30static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp, 30static __be32 nfsacld_proc_getacl(struct svc_rqst *rqstp)
31 struct nfsd3_getaclargs *argp, struct nfsd3_getaclres *resp)
32{ 31{
32 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
33 struct nfsd3_getaclres *resp = rqstp->rq_resp;
33 struct posix_acl *acl; 34 struct posix_acl *acl;
34 struct inode *inode; 35 struct inode *inode;
35 svc_fh *fh; 36 svc_fh *fh;
@@ -87,10 +88,10 @@ fail:
87/* 88/*
88 * Set the Access and/or Default ACL of a file. 89 * Set the Access and/or Default ACL of a file.
89 */ 90 */
90static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp, 91static __be32 nfsacld_proc_setacl(struct svc_rqst *rqstp)
91 struct nfsd3_setaclargs *argp,
92 struct nfsd_attrstat *resp)
93{ 92{
93 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
94 struct nfsd_attrstat *resp = rqstp->rq_resp;
94 struct inode *inode; 95 struct inode *inode;
95 svc_fh *fh; 96 svc_fh *fh;
96 __be32 nfserr = 0; 97 __be32 nfserr = 0;
@@ -141,9 +142,10 @@ out_errno:
141/* 142/*
142 * Check file attributes 143 * Check file attributes
143 */ 144 */
144static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp, 145static __be32 nfsacld_proc_getattr(struct svc_rqst *rqstp)
145 struct nfsd_fhandle *argp, struct nfsd_attrstat *resp)
146{ 146{
147 struct nfsd_fhandle *argp = rqstp->rq_argp;
148 struct nfsd_attrstat *resp = rqstp->rq_resp;
147 __be32 nfserr; 149 __be32 nfserr;
148 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh)); 150 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
149 151
@@ -158,9 +160,10 @@ static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp,
158/* 160/*
159 * Check file access 161 * Check file access
160 */ 162 */
161static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp, 163static __be32 nfsacld_proc_access(struct svc_rqst *rqstp)
162 struct nfsd3_accessres *resp)
163{ 164{
165 struct nfsd3_accessargs *argp = rqstp->rq_argp;
166 struct nfsd3_accessres *resp = rqstp->rq_resp;
164 __be32 nfserr; 167 __be32 nfserr;
165 168
166 dprintk("nfsd: ACCESS(2acl) %s 0x%x\n", 169 dprintk("nfsd: ACCESS(2acl) %s 0x%x\n",
@@ -179,9 +182,10 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessarg
179/* 182/*
180 * XDR decode functions 183 * XDR decode functions
181 */ 184 */
182static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p, 185static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
183 struct nfsd3_getaclargs *argp)
184{ 186{
187 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
188
185 p = nfs2svc_decode_fh(p, &argp->fh); 189 p = nfs2svc_decode_fh(p, &argp->fh);
186 if (!p) 190 if (!p)
187 return 0; 191 return 0;
@@ -191,9 +195,9 @@ static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
191} 195}
192 196
193 197
194static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p, 198static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
195 struct nfsd3_setaclargs *argp)
196{ 199{
200 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
197 struct kvec *head = rqstp->rq_arg.head; 201 struct kvec *head = rqstp->rq_arg.head;
198 unsigned int base; 202 unsigned int base;
199 int n; 203 int n;
@@ -217,18 +221,20 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
217 return (n > 0); 221 return (n > 0);
218} 222}
219 223
220static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p, 224static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p)
221 struct nfsd_fhandle *argp)
222{ 225{
226 struct nfsd_fhandle *argp = rqstp->rq_argp;
227
223 p = nfs2svc_decode_fh(p, &argp->fh); 228 p = nfs2svc_decode_fh(p, &argp->fh);
224 if (!p) 229 if (!p)
225 return 0; 230 return 0;
226 return xdr_argsize_check(rqstp, p); 231 return xdr_argsize_check(rqstp, p);
227} 232}
228 233
229static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p, 234static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
230 struct nfsd3_accessargs *argp)
231{ 235{
236 struct nfsd3_accessargs *argp = rqstp->rq_argp;
237
232 p = nfs2svc_decode_fh(p, &argp->fh); 238 p = nfs2svc_decode_fh(p, &argp->fh);
233 if (!p) 239 if (!p)
234 return 0; 240 return 0;
@@ -245,15 +251,15 @@ static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
245 * There must be an encoding function for void results so svc_process 251 * There must be an encoding function for void results so svc_process
246 * will work properly. 252 * will work properly.
247 */ 253 */
248static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 254static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
249{ 255{
250 return xdr_ressize_check(rqstp, p); 256 return xdr_ressize_check(rqstp, p);
251} 257}
252 258
253/* GETACL */ 259/* GETACL */
254static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, 260static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
255 struct nfsd3_getaclres *resp)
256{ 261{
262 struct nfsd3_getaclres *resp = rqstp->rq_resp;
257 struct dentry *dentry = resp->fh.fh_dentry; 263 struct dentry *dentry = resp->fh.fh_dentry;
258 struct inode *inode; 264 struct inode *inode;
259 struct kvec *head = rqstp->rq_res.head; 265 struct kvec *head = rqstp->rq_res.head;
@@ -296,17 +302,19 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
296 return (n > 0); 302 return (n > 0);
297} 303}
298 304
299static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p, 305static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p)
300 struct nfsd_attrstat *resp)
301{ 306{
307 struct nfsd_attrstat *resp = rqstp->rq_resp;
308
302 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); 309 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
303 return xdr_ressize_check(rqstp, p); 310 return xdr_ressize_check(rqstp, p);
304} 311}
305 312
306/* ACCESS */ 313/* ACCESS */
307static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, 314static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
308 struct nfsd3_accessres *resp)
309{ 315{
316 struct nfsd3_accessres *resp = rqstp->rq_resp;
317
310 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); 318 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
311 *p++ = htonl(resp->access); 319 *p++ = htonl(resp->access);
312 return xdr_ressize_check(rqstp, p); 320 return xdr_ressize_check(rqstp, p);
@@ -315,27 +323,27 @@ static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
315/* 323/*
316 * XDR release functions 324 * XDR release functions
317 */ 325 */
318static int nfsaclsvc_release_getacl(struct svc_rqst *rqstp, __be32 *p, 326static void nfsaclsvc_release_getacl(struct svc_rqst *rqstp)
319 struct nfsd3_getaclres *resp)
320{ 327{
328 struct nfsd3_getaclres *resp = rqstp->rq_resp;
329
321 fh_put(&resp->fh); 330 fh_put(&resp->fh);
322 posix_acl_release(resp->acl_access); 331 posix_acl_release(resp->acl_access);
323 posix_acl_release(resp->acl_default); 332 posix_acl_release(resp->acl_default);
324 return 1;
325} 333}
326 334
327static int nfsaclsvc_release_attrstat(struct svc_rqst *rqstp, __be32 *p, 335static void nfsaclsvc_release_attrstat(struct svc_rqst *rqstp)
328 struct nfsd_attrstat *resp)
329{ 336{
337 struct nfsd_attrstat *resp = rqstp->rq_resp;
338
330 fh_put(&resp->fh); 339 fh_put(&resp->fh);
331 return 1;
332} 340}
333 341
334static int nfsaclsvc_release_access(struct svc_rqst *rqstp, __be32 *p, 342static void nfsaclsvc_release_access(struct svc_rqst *rqstp)
335 struct nfsd3_accessres *resp)
336{ 343{
337 fh_put(&resp->fh); 344 struct nfsd3_accessres *resp = rqstp->rq_resp;
338 return 1; 345
346 fh_put(&resp->fh);
339} 347}
340 348
341#define nfsaclsvc_decode_voidargs NULL 349#define nfsaclsvc_decode_voidargs NULL
@@ -345,24 +353,24 @@ static int nfsaclsvc_release_access(struct svc_rqst *rqstp, __be32 *p,
345#define nfsd3_voidres nfsd3_voidargs 353#define nfsd3_voidres nfsd3_voidargs
346struct nfsd3_voidargs { int dummy; }; 354struct nfsd3_voidargs { int dummy; };
347 355
348#define PROC(name, argt, rest, relt, cache, respsize) \ 356#define PROC(name, argt, rest, relt, cache, respsize) \
349 { (svc_procfunc) nfsacld_proc_##name, \ 357{ \
350 (kxdrproc_t) nfsaclsvc_decode_##argt##args, \ 358 .pc_func = nfsacld_proc_##name, \
351 (kxdrproc_t) nfsaclsvc_encode_##rest##res, \ 359 .pc_decode = nfsaclsvc_decode_##argt##args, \
352 (kxdrproc_t) nfsaclsvc_release_##relt, \ 360 .pc_encode = nfsaclsvc_encode_##rest##res, \
353 sizeof(struct nfsd3_##argt##args), \ 361 .pc_release = nfsaclsvc_release_##relt, \
354 sizeof(struct nfsd3_##rest##res), \ 362 .pc_argsize = sizeof(struct nfsd3_##argt##args), \
355 0, \ 363 .pc_ressize = sizeof(struct nfsd3_##rest##res), \
356 cache, \ 364 .pc_cachetype = cache, \
357 respsize, \ 365 .pc_xdrressize = respsize, \
358 } 366}
359 367
360#define ST 1 /* status*/ 368#define ST 1 /* status*/
361#define AT 21 /* attributes */ 369#define AT 21 /* attributes */
362#define pAT (1+AT) /* post attributes - conditional */ 370#define pAT (1+AT) /* post attributes - conditional */
363#define ACL (1+NFS_ACL_MAX_ENTRIES*3) /* Access Control List */ 371#define ACL (1+NFS_ACL_MAX_ENTRIES*3) /* Access Control List */
364 372
365static struct svc_procedure nfsd_acl_procedures2[] = { 373static const struct svc_procedure nfsd_acl_procedures2[] = {
366 PROC(null, void, void, void, RC_NOCACHE, ST), 374 PROC(null, void, void, void, RC_NOCACHE, ST),
367 PROC(getacl, getacl, getacl, getacl, RC_NOCACHE, ST+1+2*(1+ACL)), 375 PROC(getacl, getacl, getacl, getacl, RC_NOCACHE, ST+1+2*(1+ACL)),
368 PROC(setacl, setacl, attrstat, attrstat, RC_NOCACHE, ST+AT), 376 PROC(setacl, setacl, attrstat, attrstat, RC_NOCACHE, ST+AT),
@@ -370,10 +378,12 @@ static struct svc_procedure nfsd_acl_procedures2[] = {
370 PROC(access, access, access, access, RC_NOCACHE, ST+AT+1), 378 PROC(access, access, access, access, RC_NOCACHE, ST+AT+1),
371}; 379};
372 380
373struct svc_version nfsd_acl_version2 = { 381static unsigned int nfsd_acl_count2[ARRAY_SIZE(nfsd_acl_procedures2)];
374 .vs_vers = 2, 382const struct svc_version nfsd_acl_version2 = {
375 .vs_nproc = 5, 383 .vs_vers = 2,
376 .vs_proc = nfsd_acl_procedures2, 384 .vs_nproc = 5,
377 .vs_dispatch = nfsd_dispatch, 385 .vs_proc = nfsd_acl_procedures2,
378 .vs_xdrsize = NFS3_SVC_XDRSIZE, 386 .vs_count = nfsd_acl_count2,
387 .vs_dispatch = nfsd_dispatch,
388 .vs_xdrsize = NFS3_SVC_XDRSIZE,
379}; 389};
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index dcb5f79076c0..01976529f042 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -18,7 +18,7 @@
18 * NULL call. 18 * NULL call.
19 */ 19 */
20static __be32 20static __be32
21nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) 21nfsd3_proc_null(struct svc_rqst *rqstp)
22{ 22{
23 return nfs_ok; 23 return nfs_ok;
24} 24}
@@ -26,9 +26,10 @@ nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
26/* 26/*
27 * Get the Access and/or Default ACL of a file. 27 * Get the Access and/or Default ACL of a file.
28 */ 28 */
29static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp, 29static __be32 nfsd3_proc_getacl(struct svc_rqst *rqstp)
30 struct nfsd3_getaclargs *argp, struct nfsd3_getaclres *resp)
31{ 30{
31 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
32 struct nfsd3_getaclres *resp = rqstp->rq_resp;
32 struct posix_acl *acl; 33 struct posix_acl *acl;
33 struct inode *inode; 34 struct inode *inode;
34 svc_fh *fh; 35 svc_fh *fh;
@@ -80,10 +81,10 @@ fail:
80/* 81/*
81 * Set the Access and/or Default ACL of a file. 82 * Set the Access and/or Default ACL of a file.
82 */ 83 */
83static __be32 nfsd3_proc_setacl(struct svc_rqst * rqstp, 84static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp)
84 struct nfsd3_setaclargs *argp,
85 struct nfsd3_attrstat *resp)
86{ 85{
86 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
87 struct nfsd3_attrstat *resp = rqstp->rq_resp;
87 struct inode *inode; 88 struct inode *inode;
88 svc_fh *fh; 89 svc_fh *fh;
89 __be32 nfserr = 0; 90 __be32 nfserr = 0;
@@ -123,9 +124,10 @@ out:
123/* 124/*
124 * XDR decode functions 125 * XDR decode functions
125 */ 126 */
126static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p, 127static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
127 struct nfsd3_getaclargs *args)
128{ 128{
129 struct nfsd3_getaclargs *args = rqstp->rq_argp;
130
129 p = nfs3svc_decode_fh(p, &args->fh); 131 p = nfs3svc_decode_fh(p, &args->fh);
130 if (!p) 132 if (!p)
131 return 0; 133 return 0;
@@ -135,9 +137,9 @@ static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
135} 137}
136 138
137 139
138static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p, 140static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
139 struct nfsd3_setaclargs *args)
140{ 141{
142 struct nfsd3_setaclargs *args = rqstp->rq_argp;
141 struct kvec *head = rqstp->rq_arg.head; 143 struct kvec *head = rqstp->rq_arg.head;
142 unsigned int base; 144 unsigned int base;
143 int n; 145 int n;
@@ -166,9 +168,9 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
166 */ 168 */
167 169
168/* GETACL */ 170/* GETACL */
169static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, 171static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
170 struct nfsd3_getaclres *resp)
171{ 172{
173 struct nfsd3_getaclres *resp = rqstp->rq_resp;
172 struct dentry *dentry = resp->fh.fh_dentry; 174 struct dentry *dentry = resp->fh.fh_dentry;
173 175
174 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); 176 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
@@ -211,9 +213,10 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
211} 213}
212 214
213/* SETACL */ 215/* SETACL */
214static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p, 216static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p)
215 struct nfsd3_attrstat *resp)
216{ 217{
218 struct nfsd3_attrstat *resp = rqstp->rq_resp;
219
217 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); 220 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh);
218 221
219 return xdr_ressize_check(rqstp, p); 222 return xdr_ressize_check(rqstp, p);
@@ -222,13 +225,13 @@ static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p,
222/* 225/*
223 * XDR release functions 226 * XDR release functions
224 */ 227 */
225static int nfs3svc_release_getacl(struct svc_rqst *rqstp, __be32 *p, 228static void nfs3svc_release_getacl(struct svc_rqst *rqstp)
226 struct nfsd3_getaclres *resp)
227{ 229{
230 struct nfsd3_getaclres *resp = rqstp->rq_resp;
231
228 fh_put(&resp->fh); 232 fh_put(&resp->fh);
229 posix_acl_release(resp->acl_access); 233 posix_acl_release(resp->acl_access);
230 posix_acl_release(resp->acl_default); 234 posix_acl_release(resp->acl_default);
231 return 1;
232} 235}
233 236
234#define nfs3svc_decode_voidargs NULL 237#define nfs3svc_decode_voidargs NULL
@@ -237,34 +240,36 @@ static int nfs3svc_release_getacl(struct svc_rqst *rqstp, __be32 *p,
237#define nfsd3_voidres nfsd3_voidargs 240#define nfsd3_voidres nfsd3_voidargs
238struct nfsd3_voidargs { int dummy; }; 241struct nfsd3_voidargs { int dummy; };
239 242
240#define PROC(name, argt, rest, relt, cache, respsize) \ 243#define PROC(name, argt, rest, relt, cache, respsize) \
241 { (svc_procfunc) nfsd3_proc_##name, \ 244{ \
242 (kxdrproc_t) nfs3svc_decode_##argt##args, \ 245 .pc_func = nfsd3_proc_##name, \
243 (kxdrproc_t) nfs3svc_encode_##rest##res, \ 246 .pc_decode = nfs3svc_decode_##argt##args, \
244 (kxdrproc_t) nfs3svc_release_##relt, \ 247 .pc_encode = nfs3svc_encode_##rest##res, \
245 sizeof(struct nfsd3_##argt##args), \ 248 .pc_release = nfs3svc_release_##relt, \
246 sizeof(struct nfsd3_##rest##res), \ 249 .pc_argsize = sizeof(struct nfsd3_##argt##args), \
247 0, \ 250 .pc_ressize = sizeof(struct nfsd3_##rest##res), \
248 cache, \ 251 .pc_cachetype = cache, \
249 respsize, \ 252 .pc_xdrressize = respsize, \
250 } 253}
251 254
252#define ST 1 /* status*/ 255#define ST 1 /* status*/
253#define AT 21 /* attributes */ 256#define AT 21 /* attributes */
254#define pAT (1+AT) /* post attributes - conditional */ 257#define pAT (1+AT) /* post attributes - conditional */
255#define ACL (1+NFS_ACL_MAX_ENTRIES*3) /* Access Control List */ 258#define ACL (1+NFS_ACL_MAX_ENTRIES*3) /* Access Control List */
256 259
257static struct svc_procedure nfsd_acl_procedures3[] = { 260static const struct svc_procedure nfsd_acl_procedures3[] = {
258 PROC(null, void, void, void, RC_NOCACHE, ST), 261 PROC(null, void, void, void, RC_NOCACHE, ST),
259 PROC(getacl, getacl, getacl, getacl, RC_NOCACHE, ST+1+2*(1+ACL)), 262 PROC(getacl, getacl, getacl, getacl, RC_NOCACHE, ST+1+2*(1+ACL)),
260 PROC(setacl, setacl, setacl, fhandle, RC_NOCACHE, ST+pAT), 263 PROC(setacl, setacl, setacl, fhandle, RC_NOCACHE, ST+pAT),
261}; 264};
262 265
263struct svc_version nfsd_acl_version3 = { 266static unsigned int nfsd_acl_count3[ARRAY_SIZE(nfsd_acl_procedures3)];
264 .vs_vers = 3, 267const struct svc_version nfsd_acl_version3 = {
265 .vs_nproc = 3, 268 .vs_vers = 3,
266 .vs_proc = nfsd_acl_procedures3, 269 .vs_nproc = 3,
267 .vs_dispatch = nfsd_dispatch, 270 .vs_proc = nfsd_acl_procedures3,
268 .vs_xdrsize = NFS3_SVC_XDRSIZE, 271 .vs_count = nfsd_acl_count3,
272 .vs_dispatch = nfsd_dispatch,
273 .vs_xdrsize = NFS3_SVC_XDRSIZE,
269}; 274};
270 275
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 045c9081eabe..2cb56a0d6625 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -31,7 +31,7 @@ static int nfs3_ftypes[] = {
31 * NULL call. 31 * NULL call.
32 */ 32 */
33static __be32 33static __be32
34nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) 34nfsd3_proc_null(struct svc_rqst *rqstp)
35{ 35{
36 return nfs_ok; 36 return nfs_ok;
37} 37}
@@ -40,9 +40,10 @@ nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
40 * Get a file's attributes 40 * Get a file's attributes
41 */ 41 */
42static __be32 42static __be32
43nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp, 43nfsd3_proc_getattr(struct svc_rqst *rqstp)
44 struct nfsd3_attrstat *resp)
45{ 44{
45 struct nfsd_fhandle *argp = rqstp->rq_argp;
46 struct nfsd3_attrstat *resp = rqstp->rq_resp;
46 __be32 nfserr; 47 __be32 nfserr;
47 48
48 dprintk("nfsd: GETATTR(3) %s\n", 49 dprintk("nfsd: GETATTR(3) %s\n",
@@ -63,9 +64,10 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
63 * Set a file's attributes 64 * Set a file's attributes
64 */ 65 */
65static __be32 66static __be32
66nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp, 67nfsd3_proc_setattr(struct svc_rqst *rqstp)
67 struct nfsd3_attrstat *resp)
68{ 68{
69 struct nfsd3_sattrargs *argp = rqstp->rq_argp;
70 struct nfsd3_attrstat *resp = rqstp->rq_resp;
69 __be32 nfserr; 71 __be32 nfserr;
70 72
71 dprintk("nfsd: SETATTR(3) %s\n", 73 dprintk("nfsd: SETATTR(3) %s\n",
@@ -81,9 +83,10 @@ nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp,
81 * Look up a path name component 83 * Look up a path name component
82 */ 84 */
83static __be32 85static __be32
84nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp, 86nfsd3_proc_lookup(struct svc_rqst *rqstp)
85 struct nfsd3_diropres *resp)
86{ 87{
88 struct nfsd3_diropargs *argp = rqstp->rq_argp;
89 struct nfsd3_diropres *resp = rqstp->rq_resp;
87 __be32 nfserr; 90 __be32 nfserr;
88 91
89 dprintk("nfsd: LOOKUP(3) %s %.*s\n", 92 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
@@ -105,9 +108,10 @@ nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
105 * Check file access 108 * Check file access
106 */ 109 */
107static __be32 110static __be32
108nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp, 111nfsd3_proc_access(struct svc_rqst *rqstp)
109 struct nfsd3_accessres *resp)
110{ 112{
113 struct nfsd3_accessargs *argp = rqstp->rq_argp;
114 struct nfsd3_accessres *resp = rqstp->rq_resp;
111 __be32 nfserr; 115 __be32 nfserr;
112 116
113 dprintk("nfsd: ACCESS(3) %s 0x%x\n", 117 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
@@ -124,9 +128,10 @@ nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
124 * Read a symlink. 128 * Read a symlink.
125 */ 129 */
126static __be32 130static __be32
127nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp, 131nfsd3_proc_readlink(struct svc_rqst *rqstp)
128 struct nfsd3_readlinkres *resp)
129{ 132{
133 struct nfsd3_readlinkargs *argp = rqstp->rq_argp;
134 struct nfsd3_readlinkres *resp = rqstp->rq_resp;
130 __be32 nfserr; 135 __be32 nfserr;
131 136
132 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh)); 137 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
@@ -142,9 +147,10 @@ nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp,
142 * Read a portion of a file. 147 * Read a portion of a file.
143 */ 148 */
144static __be32 149static __be32
145nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp, 150nfsd3_proc_read(struct svc_rqst *rqstp)
146 struct nfsd3_readres *resp)
147{ 151{
152 struct nfsd3_readargs *argp = rqstp->rq_argp;
153 struct nfsd3_readres *resp = rqstp->rq_resp;
148 __be32 nfserr; 154 __be32 nfserr;
149 u32 max_blocksize = svc_max_payload(rqstp); 155 u32 max_blocksize = svc_max_payload(rqstp);
150 unsigned long cnt = min(argp->count, max_blocksize); 156 unsigned long cnt = min(argp->count, max_blocksize);
@@ -179,9 +185,10 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
179 * Write data to a file 185 * Write data to a file
180 */ 186 */
181static __be32 187static __be32
182nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp, 188nfsd3_proc_write(struct svc_rqst *rqstp)
183 struct nfsd3_writeres *resp)
184{ 189{
190 struct nfsd3_writeargs *argp = rqstp->rq_argp;
191 struct nfsd3_writeres *resp = rqstp->rq_resp;
185 __be32 nfserr; 192 __be32 nfserr;
186 unsigned long cnt = argp->len; 193 unsigned long cnt = argp->len;
187 194
@@ -206,9 +213,10 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
206 * first reports about SunOS compatibility problems start to pour in... 213 * first reports about SunOS compatibility problems start to pour in...
207 */ 214 */
208static __be32 215static __be32
209nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp, 216nfsd3_proc_create(struct svc_rqst *rqstp)
210 struct nfsd3_diropres *resp)
211{ 217{
218 struct nfsd3_createargs *argp = rqstp->rq_argp;
219 struct nfsd3_diropres *resp = rqstp->rq_resp;
212 svc_fh *dirfhp, *newfhp = NULL; 220 svc_fh *dirfhp, *newfhp = NULL;
213 struct iattr *attr; 221 struct iattr *attr;
214 __be32 nfserr; 222 __be32 nfserr;
@@ -243,9 +251,10 @@ nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
243 * Make directory. This operation is not idempotent. 251 * Make directory. This operation is not idempotent.
244 */ 252 */
245static __be32 253static __be32
246nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp, 254nfsd3_proc_mkdir(struct svc_rqst *rqstp)
247 struct nfsd3_diropres *resp)
248{ 255{
256 struct nfsd3_createargs *argp = rqstp->rq_argp;
257 struct nfsd3_diropres *resp = rqstp->rq_resp;
249 __be32 nfserr; 258 __be32 nfserr;
250 259
251 dprintk("nfsd: MKDIR(3) %s %.*s\n", 260 dprintk("nfsd: MKDIR(3) %s %.*s\n",
@@ -263,9 +272,10 @@ nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
263} 272}
264 273
265static __be32 274static __be32
266nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp, 275nfsd3_proc_symlink(struct svc_rqst *rqstp)
267 struct nfsd3_diropres *resp)
268{ 276{
277 struct nfsd3_symlinkargs *argp = rqstp->rq_argp;
278 struct nfsd3_diropres *resp = rqstp->rq_resp;
269 __be32 nfserr; 279 __be32 nfserr;
270 280
271 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n", 281 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
@@ -284,9 +294,10 @@ nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
284 * Make socket/fifo/device. 294 * Make socket/fifo/device.
285 */ 295 */
286static __be32 296static __be32
287nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp, 297nfsd3_proc_mknod(struct svc_rqst *rqstp)
288 struct nfsd3_diropres *resp)
289{ 298{
299 struct nfsd3_mknodargs *argp = rqstp->rq_argp;
300 struct nfsd3_diropres *resp = rqstp->rq_resp;
290 __be32 nfserr; 301 __be32 nfserr;
291 int type; 302 int type;
292 dev_t rdev = 0; 303 dev_t rdev = 0;
@@ -321,9 +332,10 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
321 * Remove file/fifo/socket etc. 332 * Remove file/fifo/socket etc.
322 */ 333 */
323static __be32 334static __be32
324nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp, 335nfsd3_proc_remove(struct svc_rqst *rqstp)
325 struct nfsd3_attrstat *resp)
326{ 336{
337 struct nfsd3_diropargs *argp = rqstp->rq_argp;
338 struct nfsd3_attrstat *resp = rqstp->rq_resp;
327 __be32 nfserr; 339 __be32 nfserr;
328 340
329 dprintk("nfsd: REMOVE(3) %s %.*s\n", 341 dprintk("nfsd: REMOVE(3) %s %.*s\n",
@@ -342,9 +354,10 @@ nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
342 * Remove a directory 354 * Remove a directory
343 */ 355 */
344static __be32 356static __be32
345nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp, 357nfsd3_proc_rmdir(struct svc_rqst *rqstp)
346 struct nfsd3_attrstat *resp)
347{ 358{
359 struct nfsd3_diropargs *argp = rqstp->rq_argp;
360 struct nfsd3_attrstat *resp = rqstp->rq_resp;
348 __be32 nfserr; 361 __be32 nfserr;
349 362
350 dprintk("nfsd: RMDIR(3) %s %.*s\n", 363 dprintk("nfsd: RMDIR(3) %s %.*s\n",
@@ -359,9 +372,10 @@ nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
359} 372}
360 373
361static __be32 374static __be32
362nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp, 375nfsd3_proc_rename(struct svc_rqst *rqstp)
363 struct nfsd3_renameres *resp)
364{ 376{
377 struct nfsd3_renameargs *argp = rqstp->rq_argp;
378 struct nfsd3_renameres *resp = rqstp->rq_resp;
365 __be32 nfserr; 379 __be32 nfserr;
366 380
367 dprintk("nfsd: RENAME(3) %s %.*s ->\n", 381 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
@@ -381,9 +395,10 @@ nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
381} 395}
382 396
383static __be32 397static __be32
384nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp, 398nfsd3_proc_link(struct svc_rqst *rqstp)
385 struct nfsd3_linkres *resp)
386{ 399{
400 struct nfsd3_linkargs *argp = rqstp->rq_argp;
401 struct nfsd3_linkres *resp = rqstp->rq_resp;
387 __be32 nfserr; 402 __be32 nfserr;
388 403
389 dprintk("nfsd: LINK(3) %s ->\n", 404 dprintk("nfsd: LINK(3) %s ->\n",
@@ -404,9 +419,10 @@ nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
404 * Read a portion of a directory. 419 * Read a portion of a directory.
405 */ 420 */
406static __be32 421static __be32
407nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp, 422nfsd3_proc_readdir(struct svc_rqst *rqstp)
408 struct nfsd3_readdirres *resp)
409{ 423{
424 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
425 struct nfsd3_readdirres *resp = rqstp->rq_resp;
410 __be32 nfserr; 426 __be32 nfserr;
411 int count; 427 int count;
412 428
@@ -440,9 +456,10 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
440 * For now, we choose to ignore the dircount parameter. 456 * For now, we choose to ignore the dircount parameter.
441 */ 457 */
442static __be32 458static __be32
443nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp, 459nfsd3_proc_readdirplus(struct svc_rqst *rqstp)
444 struct nfsd3_readdirres *resp)
445{ 460{
461 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
462 struct nfsd3_readdirres *resp = rqstp->rq_resp;
446 __be32 nfserr; 463 __be32 nfserr;
447 int count = 0; 464 int count = 0;
448 loff_t offset; 465 loff_t offset;
@@ -507,9 +524,10 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
507 * Get file system stats 524 * Get file system stats
508 */ 525 */
509static __be32 526static __be32
510nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, 527nfsd3_proc_fsstat(struct svc_rqst *rqstp)
511 struct nfsd3_fsstatres *resp)
512{ 528{
529 struct nfsd_fhandle *argp = rqstp->rq_argp;
530 struct nfsd3_fsstatres *resp = rqstp->rq_resp;
513 __be32 nfserr; 531 __be32 nfserr;
514 532
515 dprintk("nfsd: FSSTAT(3) %s\n", 533 dprintk("nfsd: FSSTAT(3) %s\n",
@@ -524,9 +542,10 @@ nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
524 * Get file system info 542 * Get file system info
525 */ 543 */
526static __be32 544static __be32
527nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, 545nfsd3_proc_fsinfo(struct svc_rqst *rqstp)
528 struct nfsd3_fsinfores *resp)
529{ 546{
547 struct nfsd_fhandle *argp = rqstp->rq_argp;
548 struct nfsd3_fsinfores *resp = rqstp->rq_resp;
530 __be32 nfserr; 549 __be32 nfserr;
531 u32 max_blocksize = svc_max_payload(rqstp); 550 u32 max_blocksize = svc_max_payload(rqstp);
532 551
@@ -567,9 +586,10 @@ nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
567 * Get pathconf info for the specified file 586 * Get pathconf info for the specified file
568 */ 587 */
569static __be32 588static __be32
570nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, 589nfsd3_proc_pathconf(struct svc_rqst *rqstp)
571 struct nfsd3_pathconfres *resp)
572{ 590{
591 struct nfsd_fhandle *argp = rqstp->rq_argp;
592 struct nfsd3_pathconfres *resp = rqstp->rq_resp;
573 __be32 nfserr; 593 __be32 nfserr;
574 594
575 dprintk("nfsd: PATHCONF(3) %s\n", 595 dprintk("nfsd: PATHCONF(3) %s\n",
@@ -610,9 +630,10 @@ nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
610 * Commit a file (range) to stable storage. 630 * Commit a file (range) to stable storage.
611 */ 631 */
612static __be32 632static __be32
613nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp, 633nfsd3_proc_commit(struct svc_rqst *rqstp)
614 struct nfsd3_commitres *resp)
615{ 634{
635 struct nfsd3_commitargs *argp = rqstp->rq_argp;
636 struct nfsd3_commitres *resp = rqstp->rq_resp;
616 __be32 nfserr; 637 __be32 nfserr;
617 638
618 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n", 639 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
@@ -647,233 +668,221 @@ nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp,
647#define nfsd3_voidres nfsd3_voidargs 668#define nfsd3_voidres nfsd3_voidargs
648struct nfsd3_voidargs { int dummy; }; 669struct nfsd3_voidargs { int dummy; };
649 670
650#define PROC(name, argt, rest, relt, cache, respsize) \
651 { (svc_procfunc) nfsd3_proc_##name, \
652 (kxdrproc_t) nfs3svc_decode_##argt##args, \
653 (kxdrproc_t) nfs3svc_encode_##rest##res, \
654 (kxdrproc_t) nfs3svc_release_##relt, \
655 sizeof(struct nfsd3_##argt##args), \
656 sizeof(struct nfsd3_##rest##res), \
657 0, \
658 cache, \
659 respsize, \
660 }
661
662#define ST 1 /* status*/ 671#define ST 1 /* status*/
663#define FH 17 /* filehandle with length */ 672#define FH 17 /* filehandle with length */
664#define AT 21 /* attributes */ 673#define AT 21 /* attributes */
665#define pAT (1+AT) /* post attributes - conditional */ 674#define pAT (1+AT) /* post attributes - conditional */
666#define WC (7+pAT) /* WCC attributes */ 675#define WC (7+pAT) /* WCC attributes */
667 676
668static struct svc_procedure nfsd_procedures3[22] = { 677static const struct svc_procedure nfsd_procedures3[22] = {
669 [NFS3PROC_NULL] = { 678 [NFS3PROC_NULL] = {
670 .pc_func = (svc_procfunc) nfsd3_proc_null, 679 .pc_func = nfsd3_proc_null,
671 .pc_encode = (kxdrproc_t) nfs3svc_encode_voidres, 680 .pc_encode = nfs3svc_encode_voidres,
672 .pc_argsize = sizeof(struct nfsd3_voidargs), 681 .pc_argsize = sizeof(struct nfsd3_voidargs),
673 .pc_ressize = sizeof(struct nfsd3_voidres), 682 .pc_ressize = sizeof(struct nfsd3_voidres),
674 .pc_cachetype = RC_NOCACHE, 683 .pc_cachetype = RC_NOCACHE,
675 .pc_xdrressize = ST, 684 .pc_xdrressize = ST,
676 }, 685 },
677 [NFS3PROC_GETATTR] = { 686 [NFS3PROC_GETATTR] = {
678 .pc_func = (svc_procfunc) nfsd3_proc_getattr, 687 .pc_func = nfsd3_proc_getattr,
679 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 688 .pc_decode = nfs3svc_decode_fhandleargs,
680 .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres, 689 .pc_encode = nfs3svc_encode_attrstatres,
681 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 690 .pc_release = nfs3svc_release_fhandle,
682 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 691 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
683 .pc_ressize = sizeof(struct nfsd3_attrstatres), 692 .pc_ressize = sizeof(struct nfsd3_attrstatres),
684 .pc_cachetype = RC_NOCACHE, 693 .pc_cachetype = RC_NOCACHE,
685 .pc_xdrressize = ST+AT, 694 .pc_xdrressize = ST+AT,
686 }, 695 },
687 [NFS3PROC_SETATTR] = { 696 [NFS3PROC_SETATTR] = {
688 .pc_func = (svc_procfunc) nfsd3_proc_setattr, 697 .pc_func = nfsd3_proc_setattr,
689 .pc_decode = (kxdrproc_t) nfs3svc_decode_sattrargs, 698 .pc_decode = nfs3svc_decode_sattrargs,
690 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 699 .pc_encode = nfs3svc_encode_wccstatres,
691 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 700 .pc_release = nfs3svc_release_fhandle,
692 .pc_argsize = sizeof(struct nfsd3_sattrargs), 701 .pc_argsize = sizeof(struct nfsd3_sattrargs),
693 .pc_ressize = sizeof(struct nfsd3_wccstatres), 702 .pc_ressize = sizeof(struct nfsd3_wccstatres),
694 .pc_cachetype = RC_REPLBUFF, 703 .pc_cachetype = RC_REPLBUFF,
695 .pc_xdrressize = ST+WC, 704 .pc_xdrressize = ST+WC,
696 }, 705 },
697 [NFS3PROC_LOOKUP] = { 706 [NFS3PROC_LOOKUP] = {
698 .pc_func = (svc_procfunc) nfsd3_proc_lookup, 707 .pc_func = nfsd3_proc_lookup,
699 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 708 .pc_decode = nfs3svc_decode_diropargs,
700 .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres, 709 .pc_encode = nfs3svc_encode_diropres,
701 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 710 .pc_release = nfs3svc_release_fhandle2,
702 .pc_argsize = sizeof(struct nfsd3_diropargs), 711 .pc_argsize = sizeof(struct nfsd3_diropargs),
703 .pc_ressize = sizeof(struct nfsd3_diropres), 712 .pc_ressize = sizeof(struct nfsd3_diropres),
704 .pc_cachetype = RC_NOCACHE, 713 .pc_cachetype = RC_NOCACHE,
705 .pc_xdrressize = ST+FH+pAT+pAT, 714 .pc_xdrressize = ST+FH+pAT+pAT,
706 }, 715 },
707 [NFS3PROC_ACCESS] = { 716 [NFS3PROC_ACCESS] = {
708 .pc_func = (svc_procfunc) nfsd3_proc_access, 717 .pc_func = nfsd3_proc_access,
709 .pc_decode = (kxdrproc_t) nfs3svc_decode_accessargs, 718 .pc_decode = nfs3svc_decode_accessargs,
710 .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres, 719 .pc_encode = nfs3svc_encode_accessres,
711 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 720 .pc_release = nfs3svc_release_fhandle,
712 .pc_argsize = sizeof(struct nfsd3_accessargs), 721 .pc_argsize = sizeof(struct nfsd3_accessargs),
713 .pc_ressize = sizeof(struct nfsd3_accessres), 722 .pc_ressize = sizeof(struct nfsd3_accessres),
714 .pc_cachetype = RC_NOCACHE, 723 .pc_cachetype = RC_NOCACHE,
715 .pc_xdrressize = ST+pAT+1, 724 .pc_xdrressize = ST+pAT+1,
716 }, 725 },
717 [NFS3PROC_READLINK] = { 726 [NFS3PROC_READLINK] = {
718 .pc_func = (svc_procfunc) nfsd3_proc_readlink, 727 .pc_func = nfsd3_proc_readlink,
719 .pc_decode = (kxdrproc_t) nfs3svc_decode_readlinkargs, 728 .pc_decode = nfs3svc_decode_readlinkargs,
720 .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres, 729 .pc_encode = nfs3svc_encode_readlinkres,
721 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 730 .pc_release = nfs3svc_release_fhandle,
722 .pc_argsize = sizeof(struct nfsd3_readlinkargs), 731 .pc_argsize = sizeof(struct nfsd3_readlinkargs),
723 .pc_ressize = sizeof(struct nfsd3_readlinkres), 732 .pc_ressize = sizeof(struct nfsd3_readlinkres),
724 .pc_cachetype = RC_NOCACHE, 733 .pc_cachetype = RC_NOCACHE,
725 .pc_xdrressize = ST+pAT+1+NFS3_MAXPATHLEN/4, 734 .pc_xdrressize = ST+pAT+1+NFS3_MAXPATHLEN/4,
726 }, 735 },
727 [NFS3PROC_READ] = { 736 [NFS3PROC_READ] = {
728 .pc_func = (svc_procfunc) nfsd3_proc_read, 737 .pc_func = nfsd3_proc_read,
729 .pc_decode = (kxdrproc_t) nfs3svc_decode_readargs, 738 .pc_decode = nfs3svc_decode_readargs,
730 .pc_encode = (kxdrproc_t) nfs3svc_encode_readres, 739 .pc_encode = nfs3svc_encode_readres,
731 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 740 .pc_release = nfs3svc_release_fhandle,
732 .pc_argsize = sizeof(struct nfsd3_readargs), 741 .pc_argsize = sizeof(struct nfsd3_readargs),
733 .pc_ressize = sizeof(struct nfsd3_readres), 742 .pc_ressize = sizeof(struct nfsd3_readres),
734 .pc_cachetype = RC_NOCACHE, 743 .pc_cachetype = RC_NOCACHE,
735 .pc_xdrressize = ST+pAT+4+NFSSVC_MAXBLKSIZE/4, 744 .pc_xdrressize = ST+pAT+4+NFSSVC_MAXBLKSIZE/4,
736 }, 745 },
737 [NFS3PROC_WRITE] = { 746 [NFS3PROC_WRITE] = {
738 .pc_func = (svc_procfunc) nfsd3_proc_write, 747 .pc_func = nfsd3_proc_write,
739 .pc_decode = (kxdrproc_t) nfs3svc_decode_writeargs, 748 .pc_decode = nfs3svc_decode_writeargs,
740 .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres, 749 .pc_encode = nfs3svc_encode_writeres,
741 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 750 .pc_release = nfs3svc_release_fhandle,
742 .pc_argsize = sizeof(struct nfsd3_writeargs), 751 .pc_argsize = sizeof(struct nfsd3_writeargs),
743 .pc_ressize = sizeof(struct nfsd3_writeres), 752 .pc_ressize = sizeof(struct nfsd3_writeres),
744 .pc_cachetype = RC_REPLBUFF, 753 .pc_cachetype = RC_REPLBUFF,
745 .pc_xdrressize = ST+WC+4, 754 .pc_xdrressize = ST+WC+4,
746 }, 755 },
747 [NFS3PROC_CREATE] = { 756 [NFS3PROC_CREATE] = {
748 .pc_func = (svc_procfunc) nfsd3_proc_create, 757 .pc_func = nfsd3_proc_create,
749 .pc_decode = (kxdrproc_t) nfs3svc_decode_createargs, 758 .pc_decode = nfs3svc_decode_createargs,
750 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 759 .pc_encode = nfs3svc_encode_createres,
751 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 760 .pc_release = nfs3svc_release_fhandle2,
752 .pc_argsize = sizeof(struct nfsd3_createargs), 761 .pc_argsize = sizeof(struct nfsd3_createargs),
753 .pc_ressize = sizeof(struct nfsd3_createres), 762 .pc_ressize = sizeof(struct nfsd3_createres),
754 .pc_cachetype = RC_REPLBUFF, 763 .pc_cachetype = RC_REPLBUFF,
755 .pc_xdrressize = ST+(1+FH+pAT)+WC, 764 .pc_xdrressize = ST+(1+FH+pAT)+WC,
756 }, 765 },
757 [NFS3PROC_MKDIR] = { 766 [NFS3PROC_MKDIR] = {
758 .pc_func = (svc_procfunc) nfsd3_proc_mkdir, 767 .pc_func = nfsd3_proc_mkdir,
759 .pc_decode = (kxdrproc_t) nfs3svc_decode_mkdirargs, 768 .pc_decode = nfs3svc_decode_mkdirargs,
760 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 769 .pc_encode = nfs3svc_encode_createres,
761 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 770 .pc_release = nfs3svc_release_fhandle2,
762 .pc_argsize = sizeof(struct nfsd3_mkdirargs), 771 .pc_argsize = sizeof(struct nfsd3_mkdirargs),
763 .pc_ressize = sizeof(struct nfsd3_createres), 772 .pc_ressize = sizeof(struct nfsd3_createres),
764 .pc_cachetype = RC_REPLBUFF, 773 .pc_cachetype = RC_REPLBUFF,
765 .pc_xdrressize = ST+(1+FH+pAT)+WC, 774 .pc_xdrressize = ST+(1+FH+pAT)+WC,
766 }, 775 },
767 [NFS3PROC_SYMLINK] = { 776 [NFS3PROC_SYMLINK] = {
768 .pc_func = (svc_procfunc) nfsd3_proc_symlink, 777 .pc_func = nfsd3_proc_symlink,
769 .pc_decode = (kxdrproc_t) nfs3svc_decode_symlinkargs, 778 .pc_decode = nfs3svc_decode_symlinkargs,
770 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 779 .pc_encode = nfs3svc_encode_createres,
771 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 780 .pc_release = nfs3svc_release_fhandle2,
772 .pc_argsize = sizeof(struct nfsd3_symlinkargs), 781 .pc_argsize = sizeof(struct nfsd3_symlinkargs),
773 .pc_ressize = sizeof(struct nfsd3_createres), 782 .pc_ressize = sizeof(struct nfsd3_createres),
774 .pc_cachetype = RC_REPLBUFF, 783 .pc_cachetype = RC_REPLBUFF,
775 .pc_xdrressize = ST+(1+FH+pAT)+WC, 784 .pc_xdrressize = ST+(1+FH+pAT)+WC,
776 }, 785 },
777 [NFS3PROC_MKNOD] = { 786 [NFS3PROC_MKNOD] = {
778 .pc_func = (svc_procfunc) nfsd3_proc_mknod, 787 .pc_func = nfsd3_proc_mknod,
779 .pc_decode = (kxdrproc_t) nfs3svc_decode_mknodargs, 788 .pc_decode = nfs3svc_decode_mknodargs,
780 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 789 .pc_encode = nfs3svc_encode_createres,
781 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 790 .pc_release = nfs3svc_release_fhandle2,
782 .pc_argsize = sizeof(struct nfsd3_mknodargs), 791 .pc_argsize = sizeof(struct nfsd3_mknodargs),
783 .pc_ressize = sizeof(struct nfsd3_createres), 792 .pc_ressize = sizeof(struct nfsd3_createres),
784 .pc_cachetype = RC_REPLBUFF, 793 .pc_cachetype = RC_REPLBUFF,
785 .pc_xdrressize = ST+(1+FH+pAT)+WC, 794 .pc_xdrressize = ST+(1+FH+pAT)+WC,
786 }, 795 },
787 [NFS3PROC_REMOVE] = { 796 [NFS3PROC_REMOVE] = {
788 .pc_func = (svc_procfunc) nfsd3_proc_remove, 797 .pc_func = nfsd3_proc_remove,
789 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 798 .pc_decode = nfs3svc_decode_diropargs,
790 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 799 .pc_encode = nfs3svc_encode_wccstatres,
791 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 800 .pc_release = nfs3svc_release_fhandle,
792 .pc_argsize = sizeof(struct nfsd3_diropargs), 801 .pc_argsize = sizeof(struct nfsd3_diropargs),
793 .pc_ressize = sizeof(struct nfsd3_wccstatres), 802 .pc_ressize = sizeof(struct nfsd3_wccstatres),
794 .pc_cachetype = RC_REPLBUFF, 803 .pc_cachetype = RC_REPLBUFF,
795 .pc_xdrressize = ST+WC, 804 .pc_xdrressize = ST+WC,
796 }, 805 },
797 [NFS3PROC_RMDIR] = { 806 [NFS3PROC_RMDIR] = {
798 .pc_func = (svc_procfunc) nfsd3_proc_rmdir, 807 .pc_func = nfsd3_proc_rmdir,
799 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs, 808 .pc_decode = nfs3svc_decode_diropargs,
800 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 809 .pc_encode = nfs3svc_encode_wccstatres,
801 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 810 .pc_release = nfs3svc_release_fhandle,
802 .pc_argsize = sizeof(struct nfsd3_diropargs), 811 .pc_argsize = sizeof(struct nfsd3_diropargs),
803 .pc_ressize = sizeof(struct nfsd3_wccstatres), 812 .pc_ressize = sizeof(struct nfsd3_wccstatres),
804 .pc_cachetype = RC_REPLBUFF, 813 .pc_cachetype = RC_REPLBUFF,
805 .pc_xdrressize = ST+WC, 814 .pc_xdrressize = ST+WC,
806 }, 815 },
807 [NFS3PROC_RENAME] = { 816 [NFS3PROC_RENAME] = {
808 .pc_func = (svc_procfunc) nfsd3_proc_rename, 817 .pc_func = nfsd3_proc_rename,
809 .pc_decode = (kxdrproc_t) nfs3svc_decode_renameargs, 818 .pc_decode = nfs3svc_decode_renameargs,
810 .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres, 819 .pc_encode = nfs3svc_encode_renameres,
811 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 820 .pc_release = nfs3svc_release_fhandle2,
812 .pc_argsize = sizeof(struct nfsd3_renameargs), 821 .pc_argsize = sizeof(struct nfsd3_renameargs),
813 .pc_ressize = sizeof(struct nfsd3_renameres), 822 .pc_ressize = sizeof(struct nfsd3_renameres),
814 .pc_cachetype = RC_REPLBUFF, 823 .pc_cachetype = RC_REPLBUFF,
815 .pc_xdrressize = ST+WC+WC, 824 .pc_xdrressize = ST+WC+WC,
816 }, 825 },
817 [NFS3PROC_LINK] = { 826 [NFS3PROC_LINK] = {
818 .pc_func = (svc_procfunc) nfsd3_proc_link, 827 .pc_func = nfsd3_proc_link,
819 .pc_decode = (kxdrproc_t) nfs3svc_decode_linkargs, 828 .pc_decode = nfs3svc_decode_linkargs,
820 .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres, 829 .pc_encode = nfs3svc_encode_linkres,
821 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2, 830 .pc_release = nfs3svc_release_fhandle2,
822 .pc_argsize = sizeof(struct nfsd3_linkargs), 831 .pc_argsize = sizeof(struct nfsd3_linkargs),
823 .pc_ressize = sizeof(struct nfsd3_linkres), 832 .pc_ressize = sizeof(struct nfsd3_linkres),
824 .pc_cachetype = RC_REPLBUFF, 833 .pc_cachetype = RC_REPLBUFF,
825 .pc_xdrressize = ST+pAT+WC, 834 .pc_xdrressize = ST+pAT+WC,
826 }, 835 },
827 [NFS3PROC_READDIR] = { 836 [NFS3PROC_READDIR] = {
828 .pc_func = (svc_procfunc) nfsd3_proc_readdir, 837 .pc_func = nfsd3_proc_readdir,
829 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirargs, 838 .pc_decode = nfs3svc_decode_readdirargs,
830 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 839 .pc_encode = nfs3svc_encode_readdirres,
831 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 840 .pc_release = nfs3svc_release_fhandle,
832 .pc_argsize = sizeof(struct nfsd3_readdirargs), 841 .pc_argsize = sizeof(struct nfsd3_readdirargs),
833 .pc_ressize = sizeof(struct nfsd3_readdirres), 842 .pc_ressize = sizeof(struct nfsd3_readdirres),
834 .pc_cachetype = RC_NOCACHE, 843 .pc_cachetype = RC_NOCACHE,
835 }, 844 },
836 [NFS3PROC_READDIRPLUS] = { 845 [NFS3PROC_READDIRPLUS] = {
837 .pc_func = (svc_procfunc) nfsd3_proc_readdirplus, 846 .pc_func = nfsd3_proc_readdirplus,
838 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirplusargs, 847 .pc_decode = nfs3svc_decode_readdirplusargs,
839 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 848 .pc_encode = nfs3svc_encode_readdirres,
840 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 849 .pc_release = nfs3svc_release_fhandle,
841 .pc_argsize = sizeof(struct nfsd3_readdirplusargs), 850 .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
842 .pc_ressize = sizeof(struct nfsd3_readdirres), 851 .pc_ressize = sizeof(struct nfsd3_readdirres),
843 .pc_cachetype = RC_NOCACHE, 852 .pc_cachetype = RC_NOCACHE,
844 }, 853 },
845 [NFS3PROC_FSSTAT] = { 854 [NFS3PROC_FSSTAT] = {
846 .pc_func = (svc_procfunc) nfsd3_proc_fsstat, 855 .pc_func = nfsd3_proc_fsstat,
847 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 856 .pc_decode = nfs3svc_decode_fhandleargs,
848 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres, 857 .pc_encode = nfs3svc_encode_fsstatres,
849 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 858 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
850 .pc_ressize = sizeof(struct nfsd3_fsstatres), 859 .pc_ressize = sizeof(struct nfsd3_fsstatres),
851 .pc_cachetype = RC_NOCACHE, 860 .pc_cachetype = RC_NOCACHE,
852 .pc_xdrressize = ST+pAT+2*6+1, 861 .pc_xdrressize = ST+pAT+2*6+1,
853 }, 862 },
854 [NFS3PROC_FSINFO] = { 863 [NFS3PROC_FSINFO] = {
855 .pc_func = (svc_procfunc) nfsd3_proc_fsinfo, 864 .pc_func = nfsd3_proc_fsinfo,
856 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 865 .pc_decode = nfs3svc_decode_fhandleargs,
857 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores, 866 .pc_encode = nfs3svc_encode_fsinfores,
858 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 867 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
859 .pc_ressize = sizeof(struct nfsd3_fsinfores), 868 .pc_ressize = sizeof(struct nfsd3_fsinfores),
860 .pc_cachetype = RC_NOCACHE, 869 .pc_cachetype = RC_NOCACHE,
861 .pc_xdrressize = ST+pAT+12, 870 .pc_xdrressize = ST+pAT+12,
862 }, 871 },
863 [NFS3PROC_PATHCONF] = { 872 [NFS3PROC_PATHCONF] = {
864 .pc_func = (svc_procfunc) nfsd3_proc_pathconf, 873 .pc_func = nfsd3_proc_pathconf,
865 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs, 874 .pc_decode = nfs3svc_decode_fhandleargs,
866 .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres, 875 .pc_encode = nfs3svc_encode_pathconfres,
867 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 876 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
868 .pc_ressize = sizeof(struct nfsd3_pathconfres), 877 .pc_ressize = sizeof(struct nfsd3_pathconfres),
869 .pc_cachetype = RC_NOCACHE, 878 .pc_cachetype = RC_NOCACHE,
870 .pc_xdrressize = ST+pAT+6, 879 .pc_xdrressize = ST+pAT+6,
871 }, 880 },
872 [NFS3PROC_COMMIT] = { 881 [NFS3PROC_COMMIT] = {
873 .pc_func = (svc_procfunc) nfsd3_proc_commit, 882 .pc_func = nfsd3_proc_commit,
874 .pc_decode = (kxdrproc_t) nfs3svc_decode_commitargs, 883 .pc_decode = nfs3svc_decode_commitargs,
875 .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres, 884 .pc_encode = nfs3svc_encode_commitres,
876 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle, 885 .pc_release = nfs3svc_release_fhandle,
877 .pc_argsize = sizeof(struct nfsd3_commitargs), 886 .pc_argsize = sizeof(struct nfsd3_commitargs),
878 .pc_ressize = sizeof(struct nfsd3_commitres), 887 .pc_ressize = sizeof(struct nfsd3_commitres),
879 .pc_cachetype = RC_NOCACHE, 888 .pc_cachetype = RC_NOCACHE,
@@ -881,10 +890,12 @@ static struct svc_procedure nfsd_procedures3[22] = {
881 }, 890 },
882}; 891};
883 892
884struct svc_version nfsd_version3 = { 893static unsigned int nfsd_count3[ARRAY_SIZE(nfsd_procedures3)];
885 .vs_vers = 3, 894const struct svc_version nfsd_version3 = {
886 .vs_nproc = 22, 895 .vs_vers = 3,
887 .vs_proc = nfsd_procedures3, 896 .vs_nproc = 22,
888 .vs_dispatch = nfsd_dispatch, 897 .vs_proc = nfsd_procedures3,
889 .vs_xdrsize = NFS3_SVC_XDRSIZE, 898 .vs_dispatch = nfsd_dispatch,
899 .vs_count = nfsd_count3,
900 .vs_xdrsize = NFS3_SVC_XDRSIZE,
890}; 901};
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 452334694a5d..bf444b664011 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -260,7 +260,7 @@ void fill_post_wcc(struct svc_fh *fhp)
260 printk("nfsd: inode locked twice during operation.\n"); 260 printk("nfsd: inode locked twice during operation.\n");
261 261
262 err = fh_getattr(fhp, &fhp->fh_post_attr); 262 err = fh_getattr(fhp, &fhp->fh_post_attr);
263 fhp->fh_post_change = d_inode(fhp->fh_dentry)->i_version; 263 fhp->fh_post_change = nfsd4_change_attribute(d_inode(fhp->fh_dentry));
264 if (err) { 264 if (err) {
265 fhp->fh_post_saved = false; 265 fhp->fh_post_saved = false;
266 /* Grab the ctime anyway - set_change_info might use it */ 266 /* Grab the ctime anyway - set_change_info might use it */
@@ -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);
@@ -353,9 +358,9 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
353} 358}
354 359
355int 360int
356nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, 361nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
357 struct nfsd3_writeargs *args)
358{ 362{
363 struct nfsd3_writeargs *args = rqstp->rq_argp;
359 unsigned int len, v, hdr, dlen; 364 unsigned int len, v, hdr, dlen;
360 u32 max_blocksize = svc_max_payload(rqstp); 365 u32 max_blocksize = svc_max_payload(rqstp);
361 struct kvec *head = rqstp->rq_arg.head; 366 struct kvec *head = rqstp->rq_arg.head;
@@ -413,9 +418,10 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
413} 418}
414 419
415int 420int
416nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, 421nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p)
417 struct nfsd3_createargs *args)
418{ 422{
423 struct nfsd3_createargs *args = rqstp->rq_argp;
424
419 if (!(p = decode_fh(p, &args->fh)) 425 if (!(p = decode_fh(p, &args->fh))
420 || !(p = decode_filename(p, &args->name, &args->len))) 426 || !(p = decode_filename(p, &args->name, &args->len)))
421 return 0; 427 return 0;
@@ -435,10 +441,12 @@ nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
435 441
436 return xdr_argsize_check(rqstp, p); 442 return xdr_argsize_check(rqstp, p);
437} 443}
444
438int 445int
439nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p, 446nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p)
440 struct nfsd3_createargs *args)
441{ 447{
448 struct nfsd3_createargs *args = rqstp->rq_argp;
449
442 if (!(p = decode_fh(p, &args->fh)) || 450 if (!(p = decode_fh(p, &args->fh)) ||
443 !(p = decode_filename(p, &args->name, &args->len))) 451 !(p = decode_filename(p, &args->name, &args->len)))
444 return 0; 452 return 0;
@@ -448,9 +456,9 @@ nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p,
448} 456}
449 457
450int 458int
451nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, 459nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
452 struct nfsd3_symlinkargs *args)
453{ 460{
461 struct nfsd3_symlinkargs *args = rqstp->rq_argp;
454 unsigned int len, avail; 462 unsigned int len, avail;
455 char *old, *new; 463 char *old, *new;
456 struct kvec *vec; 464 struct kvec *vec;
@@ -500,9 +508,10 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
500} 508}
501 509
502int 510int
503nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p, 511nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p)
504 struct nfsd3_mknodargs *args)
505{ 512{
513 struct nfsd3_mknodargs *args = rqstp->rq_argp;
514
506 if (!(p = decode_fh(p, &args->fh)) 515 if (!(p = decode_fh(p, &args->fh))
507 || !(p = decode_filename(p, &args->name, &args->len))) 516 || !(p = decode_filename(p, &args->name, &args->len)))
508 return 0; 517 return 0;
@@ -522,9 +531,10 @@ nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p,
522} 531}
523 532
524int 533int
525nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, 534nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p)
526 struct nfsd3_renameargs *args)
527{ 535{
536 struct nfsd3_renameargs *args = rqstp->rq_argp;
537
528 if (!(p = decode_fh(p, &args->ffh)) 538 if (!(p = decode_fh(p, &args->ffh))
529 || !(p = decode_filename(p, &args->fname, &args->flen)) 539 || !(p = decode_filename(p, &args->fname, &args->flen))
530 || !(p = decode_fh(p, &args->tfh)) 540 || !(p = decode_fh(p, &args->tfh))
@@ -535,9 +545,10 @@ nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
535} 545}
536 546
537int 547int
538nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, 548nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p)
539 struct nfsd3_readlinkargs *args)
540{ 549{
550 struct nfsd3_readlinkargs *args = rqstp->rq_argp;
551
541 p = decode_fh(p, &args->fh); 552 p = decode_fh(p, &args->fh);
542 if (!p) 553 if (!p)
543 return 0; 554 return 0;
@@ -547,9 +558,10 @@ nfs3svc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p,
547} 558}
548 559
549int 560int
550nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, 561nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p)
551 struct nfsd3_linkargs *args)
552{ 562{
563 struct nfsd3_linkargs *args = rqstp->rq_argp;
564
553 if (!(p = decode_fh(p, &args->ffh)) 565 if (!(p = decode_fh(p, &args->ffh))
554 || !(p = decode_fh(p, &args->tfh)) 566 || !(p = decode_fh(p, &args->tfh))
555 || !(p = decode_filename(p, &args->tname, &args->tlen))) 567 || !(p = decode_filename(p, &args->tname, &args->tlen)))
@@ -559,9 +571,9 @@ nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
559} 571}
560 572
561int 573int
562nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, 574nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
563 struct nfsd3_readdirargs *args)
564{ 575{
576 struct nfsd3_readdirargs *args = rqstp->rq_argp;
565 p = decode_fh(p, &args->fh); 577 p = decode_fh(p, &args->fh);
566 if (!p) 578 if (!p)
567 return 0; 579 return 0;
@@ -576,9 +588,9 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
576} 588}
577 589
578int 590int
579nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p, 591nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p)
580 struct nfsd3_readdirargs *args)
581{ 592{
593 struct nfsd3_readdirargs *args = rqstp->rq_argp;
582 int len; 594 int len;
583 u32 max_blocksize = svc_max_payload(rqstp); 595 u32 max_blocksize = svc_max_payload(rqstp);
584 596
@@ -602,9 +614,9 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p,
602} 614}
603 615
604int 616int
605nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p, 617nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p)
606 struct nfsd3_commitargs *args)
607{ 618{
619 struct nfsd3_commitargs *args = rqstp->rq_argp;
608 p = decode_fh(p, &args->fh); 620 p = decode_fh(p, &args->fh);
609 if (!p) 621 if (!p)
610 return 0; 622 return 0;
@@ -622,16 +634,17 @@ nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p,
622 * will work properly. 634 * will work properly.
623 */ 635 */
624int 636int
625nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 637nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
626{ 638{
627 return xdr_ressize_check(rqstp, p); 639 return xdr_ressize_check(rqstp, p);
628} 640}
629 641
630/* GETATTR */ 642/* GETATTR */
631int 643int
632nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, 644nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p)
633 struct nfsd3_attrstat *resp)
634{ 645{
646 struct nfsd3_attrstat *resp = rqstp->rq_resp;
647
635 if (resp->status == 0) { 648 if (resp->status == 0) {
636 lease_get_mtime(d_inode(resp->fh.fh_dentry), 649 lease_get_mtime(d_inode(resp->fh.fh_dentry),
637 &resp->stat.mtime); 650 &resp->stat.mtime);
@@ -642,18 +655,20 @@ nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p,
642 655
643/* SETATTR, REMOVE, RMDIR */ 656/* SETATTR, REMOVE, RMDIR */
644int 657int
645nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p, 658nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p)
646 struct nfsd3_attrstat *resp)
647{ 659{
660 struct nfsd3_attrstat *resp = rqstp->rq_resp;
661
648 p = encode_wcc_data(rqstp, p, &resp->fh); 662 p = encode_wcc_data(rqstp, p, &resp->fh);
649 return xdr_ressize_check(rqstp, p); 663 return xdr_ressize_check(rqstp, p);
650} 664}
651 665
652/* LOOKUP */ 666/* LOOKUP */
653int 667int
654nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, 668nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p)
655 struct nfsd3_diropres *resp)
656{ 669{
670 struct nfsd3_diropres *resp = rqstp->rq_resp;
671
657 if (resp->status == 0) { 672 if (resp->status == 0) {
658 p = encode_fh(p, &resp->fh); 673 p = encode_fh(p, &resp->fh);
659 p = encode_post_op_attr(rqstp, p, &resp->fh); 674 p = encode_post_op_attr(rqstp, p, &resp->fh);
@@ -664,9 +679,10 @@ nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p,
664 679
665/* ACCESS */ 680/* ACCESS */
666int 681int
667nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, 682nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
668 struct nfsd3_accessres *resp)
669{ 683{
684 struct nfsd3_accessres *resp = rqstp->rq_resp;
685
670 p = encode_post_op_attr(rqstp, p, &resp->fh); 686 p = encode_post_op_attr(rqstp, p, &resp->fh);
671 if (resp->status == 0) 687 if (resp->status == 0)
672 *p++ = htonl(resp->access); 688 *p++ = htonl(resp->access);
@@ -675,9 +691,10 @@ nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p,
675 691
676/* READLINK */ 692/* READLINK */
677int 693int
678nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, 694nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
679 struct nfsd3_readlinkres *resp)
680{ 695{
696 struct nfsd3_readlinkres *resp = rqstp->rq_resp;
697
681 p = encode_post_op_attr(rqstp, p, &resp->fh); 698 p = encode_post_op_attr(rqstp, p, &resp->fh);
682 if (resp->status == 0) { 699 if (resp->status == 0) {
683 *p++ = htonl(resp->len); 700 *p++ = htonl(resp->len);
@@ -696,9 +713,10 @@ nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
696 713
697/* READ */ 714/* READ */
698int 715int
699nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p, 716nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
700 struct nfsd3_readres *resp)
701{ 717{
718 struct nfsd3_readres *resp = rqstp->rq_resp;
719
702 p = encode_post_op_attr(rqstp, p, &resp->fh); 720 p = encode_post_op_attr(rqstp, p, &resp->fh);
703 if (resp->status == 0) { 721 if (resp->status == 0) {
704 *p++ = htonl(resp->count); 722 *p++ = htonl(resp->count);
@@ -720,9 +738,9 @@ nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
720 738
721/* WRITE */ 739/* WRITE */
722int 740int
723nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p, 741nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p)
724 struct nfsd3_writeres *resp)
725{ 742{
743 struct nfsd3_writeres *resp = rqstp->rq_resp;
726 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 744 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
727 745
728 p = encode_wcc_data(rqstp, p, &resp->fh); 746 p = encode_wcc_data(rqstp, p, &resp->fh);
@@ -737,9 +755,10 @@ nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p,
737 755
738/* CREATE, MKDIR, SYMLINK, MKNOD */ 756/* CREATE, MKDIR, SYMLINK, MKNOD */
739int 757int
740nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p, 758nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p)
741 struct nfsd3_diropres *resp)
742{ 759{
760 struct nfsd3_diropres *resp = rqstp->rq_resp;
761
743 if (resp->status == 0) { 762 if (resp->status == 0) {
744 *p++ = xdr_one; 763 *p++ = xdr_one;
745 p = encode_fh(p, &resp->fh); 764 p = encode_fh(p, &resp->fh);
@@ -751,9 +770,10 @@ nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p,
751 770
752/* RENAME */ 771/* RENAME */
753int 772int
754nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p, 773nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p)
755 struct nfsd3_renameres *resp)
756{ 774{
775 struct nfsd3_renameres *resp = rqstp->rq_resp;
776
757 p = encode_wcc_data(rqstp, p, &resp->ffh); 777 p = encode_wcc_data(rqstp, p, &resp->ffh);
758 p = encode_wcc_data(rqstp, p, &resp->tfh); 778 p = encode_wcc_data(rqstp, p, &resp->tfh);
759 return xdr_ressize_check(rqstp, p); 779 return xdr_ressize_check(rqstp, p);
@@ -761,9 +781,10 @@ nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p,
761 781
762/* LINK */ 782/* LINK */
763int 783int
764nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p, 784nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p)
765 struct nfsd3_linkres *resp)
766{ 785{
786 struct nfsd3_linkres *resp = rqstp->rq_resp;
787
767 p = encode_post_op_attr(rqstp, p, &resp->fh); 788 p = encode_post_op_attr(rqstp, p, &resp->fh);
768 p = encode_wcc_data(rqstp, p, &resp->tfh); 789 p = encode_wcc_data(rqstp, p, &resp->tfh);
769 return xdr_ressize_check(rqstp, p); 790 return xdr_ressize_check(rqstp, p);
@@ -771,9 +792,10 @@ nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p,
771 792
772/* READDIR */ 793/* READDIR */
773int 794int
774nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, 795nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
775 struct nfsd3_readdirres *resp)
776{ 796{
797 struct nfsd3_readdirres *resp = rqstp->rq_resp;
798
777 p = encode_post_op_attr(rqstp, p, &resp->fh); 799 p = encode_post_op_attr(rqstp, p, &resp->fh);
778 800
779 if (resp->status == 0) { 801 if (resp->status == 0) {
@@ -1021,9 +1043,9 @@ nfs3svc_encode_entry_plus(void *cd, const char *name,
1021 1043
1022/* FSSTAT */ 1044/* FSSTAT */
1023int 1045int
1024nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p, 1046nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p)
1025 struct nfsd3_fsstatres *resp)
1026{ 1047{
1048 struct nfsd3_fsstatres *resp = rqstp->rq_resp;
1027 struct kstatfs *s = &resp->stats; 1049 struct kstatfs *s = &resp->stats;
1028 u64 bs = s->f_bsize; 1050 u64 bs = s->f_bsize;
1029 1051
@@ -1043,9 +1065,10 @@ nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p,
1043 1065
1044/* FSINFO */ 1066/* FSINFO */
1045int 1067int
1046nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p, 1068nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p)
1047 struct nfsd3_fsinfores *resp)
1048{ 1069{
1070 struct nfsd3_fsinfores *resp = rqstp->rq_resp;
1071
1049 *p++ = xdr_zero; /* no post_op_attr */ 1072 *p++ = xdr_zero; /* no post_op_attr */
1050 1073
1051 if (resp->status == 0) { 1074 if (resp->status == 0) {
@@ -1067,9 +1090,10 @@ nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p,
1067 1090
1068/* PATHCONF */ 1091/* PATHCONF */
1069int 1092int
1070nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p, 1093nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p)
1071 struct nfsd3_pathconfres *resp)
1072{ 1094{
1095 struct nfsd3_pathconfres *resp = rqstp->rq_resp;
1096
1073 *p++ = xdr_zero; /* no post_op_attr */ 1097 *p++ = xdr_zero; /* no post_op_attr */
1074 1098
1075 if (resp->status == 0) { 1099 if (resp->status == 0) {
@@ -1086,9 +1110,9 @@ nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p,
1086 1110
1087/* COMMIT */ 1111/* COMMIT */
1088int 1112int
1089nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p, 1113nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p)
1090 struct nfsd3_commitres *resp)
1091{ 1114{
1115 struct nfsd3_commitres *resp = rqstp->rq_resp;
1092 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 1116 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
1093 1117
1094 p = encode_wcc_data(rqstp, p, &resp->fh); 1118 p = encode_wcc_data(rqstp, p, &resp->fh);
@@ -1103,19 +1127,19 @@ nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p,
1103/* 1127/*
1104 * XDR release functions 1128 * XDR release functions
1105 */ 1129 */
1106int 1130void
1107nfs3svc_release_fhandle(struct svc_rqst *rqstp, __be32 *p, 1131nfs3svc_release_fhandle(struct svc_rqst *rqstp)
1108 struct nfsd3_attrstat *resp)
1109{ 1132{
1133 struct nfsd3_attrstat *resp = rqstp->rq_resp;
1134
1110 fh_put(&resp->fh); 1135 fh_put(&resp->fh);
1111 return 1;
1112} 1136}
1113 1137
1114int 1138void
1115nfs3svc_release_fhandle2(struct svc_rqst *rqstp, __be32 *p, 1139nfs3svc_release_fhandle2(struct svc_rqst *rqstp)
1116 struct nfsd3_fhandle_pair *resp)
1117{ 1140{
1141 struct nfsd3_fhandle_pair *resp = rqstp->rq_resp;
1142
1118 fh_put(&resp->fh1); 1143 fh_put(&resp->fh1);
1119 fh_put(&resp->fh2); 1144 fh_put(&resp->fh2);
1120 return 1;
1121} 1145}
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 0274db6e65d0..b45083c0f9ae 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -468,7 +468,7 @@ static int decode_cb_sequence4res(struct xdr_stream *xdr,
468 * NB: Without this zero space reservation, callbacks over krb5p fail 468 * NB: Without this zero space reservation, callbacks over krb5p fail
469 */ 469 */
470static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr, 470static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
471 void *__unused) 471 const void *__unused)
472{ 472{
473 xdr_reserve_space(xdr, 0); 473 xdr_reserve_space(xdr, 0);
474} 474}
@@ -477,8 +477,9 @@ static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
477 * 20.2. Operation 4: CB_RECALL - Recall a Delegation 477 * 20.2. Operation 4: CB_RECALL - Recall a Delegation
478 */ 478 */
479static void nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, struct xdr_stream *xdr, 479static void nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, struct xdr_stream *xdr,
480 const struct nfsd4_callback *cb) 480 const void *data)
481{ 481{
482 const struct nfsd4_callback *cb = data;
482 const struct nfs4_delegation *dp = cb_to_delegation(cb); 483 const struct nfs4_delegation *dp = cb_to_delegation(cb);
483 struct nfs4_cb_compound_hdr hdr = { 484 struct nfs4_cb_compound_hdr hdr = {
484 .ident = cb->cb_clp->cl_cb_ident, 485 .ident = cb->cb_clp->cl_cb_ident,
@@ -512,8 +513,9 @@ static int nfs4_xdr_dec_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
512 */ 513 */
513static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp, 514static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp,
514 struct xdr_stream *xdr, 515 struct xdr_stream *xdr,
515 struct nfsd4_callback *cb) 516 void *data)
516{ 517{
518 struct nfsd4_callback *cb = data;
517 struct nfs4_cb_compound_hdr hdr; 519 struct nfs4_cb_compound_hdr hdr;
518 int status; 520 int status;
519 521
@@ -585,8 +587,9 @@ static void encode_cb_layout4args(struct xdr_stream *xdr,
585 587
586static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req, 588static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req,
587 struct xdr_stream *xdr, 589 struct xdr_stream *xdr,
588 const struct nfsd4_callback *cb) 590 const void *data)
589{ 591{
592 const struct nfsd4_callback *cb = data;
590 const struct nfs4_layout_stateid *ls = 593 const struct nfs4_layout_stateid *ls =
591 container_of(cb, struct nfs4_layout_stateid, ls_recall); 594 container_of(cb, struct nfs4_layout_stateid, ls_recall);
592 struct nfs4_cb_compound_hdr hdr = { 595 struct nfs4_cb_compound_hdr hdr = {
@@ -602,8 +605,9 @@ static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req,
602 605
603static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp, 606static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp,
604 struct xdr_stream *xdr, 607 struct xdr_stream *xdr,
605 struct nfsd4_callback *cb) 608 void *data)
606{ 609{
610 struct nfsd4_callback *cb = data;
607 struct nfs4_cb_compound_hdr hdr; 611 struct nfs4_cb_compound_hdr hdr;
608 int status; 612 int status;
609 613
@@ -631,8 +635,9 @@ static void encode_stateowner(struct xdr_stream *xdr, struct nfs4_stateowner *so
631 635
632static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req, 636static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req,
633 struct xdr_stream *xdr, 637 struct xdr_stream *xdr,
634 const struct nfsd4_callback *cb) 638 const void *data)
635{ 639{
640 const struct nfsd4_callback *cb = data;
636 const struct nfsd4_blocked_lock *nbl = 641 const struct nfsd4_blocked_lock *nbl =
637 container_of(cb, struct nfsd4_blocked_lock, nbl_cb); 642 container_of(cb, struct nfsd4_blocked_lock, nbl_cb);
638 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)nbl->nbl_lock.fl_owner; 643 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)nbl->nbl_lock.fl_owner;
@@ -659,8 +664,9 @@ static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req,
659 664
660static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp, 665static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
661 struct xdr_stream *xdr, 666 struct xdr_stream *xdr,
662 struct nfsd4_callback *cb) 667 void *data)
663{ 668{
669 struct nfsd4_callback *cb = data;
664 struct nfs4_cb_compound_hdr hdr; 670 struct nfs4_cb_compound_hdr hdr;
665 int status; 671 int status;
666 672
@@ -682,15 +688,15 @@ static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
682#define PROC(proc, call, argtype, restype) \ 688#define PROC(proc, call, argtype, restype) \
683[NFSPROC4_CLNT_##proc] = { \ 689[NFSPROC4_CLNT_##proc] = { \
684 .p_proc = NFSPROC4_CB_##call, \ 690 .p_proc = NFSPROC4_CB_##call, \
685 .p_encode = (kxdreproc_t)nfs4_xdr_enc_##argtype, \ 691 .p_encode = nfs4_xdr_enc_##argtype, \
686 .p_decode = (kxdrdproc_t)nfs4_xdr_dec_##restype, \ 692 .p_decode = nfs4_xdr_dec_##restype, \
687 .p_arglen = NFS4_enc_##argtype##_sz, \ 693 .p_arglen = NFS4_enc_##argtype##_sz, \
688 .p_replen = NFS4_dec_##restype##_sz, \ 694 .p_replen = NFS4_dec_##restype##_sz, \
689 .p_statidx = NFSPROC4_CB_##call, \ 695 .p_statidx = NFSPROC4_CB_##call, \
690 .p_name = #proc, \ 696 .p_name = #proc, \
691} 697}
692 698
693static struct rpc_procinfo nfs4_cb_procedures[] = { 699static const struct rpc_procinfo nfs4_cb_procedures[] = {
694 PROC(CB_NULL, NULL, cb_null, cb_null), 700 PROC(CB_NULL, NULL, cb_null, cb_null),
695 PROC(CB_RECALL, COMPOUND, cb_recall, cb_recall), 701 PROC(CB_RECALL, COMPOUND, cb_recall, cb_recall),
696#ifdef CONFIG_NFSD_PNFS 702#ifdef CONFIG_NFSD_PNFS
@@ -699,7 +705,8 @@ static struct rpc_procinfo nfs4_cb_procedures[] = {
699 PROC(CB_NOTIFY_LOCK, COMPOUND, cb_notify_lock, cb_notify_lock), 705 PROC(CB_NOTIFY_LOCK, COMPOUND, cb_notify_lock, cb_notify_lock),
700}; 706};
701 707
702static struct rpc_version nfs_cb_version4 = { 708static unsigned int nfs4_cb_counts[ARRAY_SIZE(nfs4_cb_procedures)];
709static const struct rpc_version nfs_cb_version4 = {
703/* 710/*
704 * Note on the callback rpc program version number: despite language in rfc 711 * Note on the callback rpc program version number: despite language in rfc
705 * 5661 section 18.36.3 requiring servers to use 4 in this field, the 712 * 5661 section 18.36.3 requiring servers to use 4 in this field, the
@@ -709,7 +716,8 @@ static struct rpc_version nfs_cb_version4 = {
709 */ 716 */
710 .number = 1, 717 .number = 1,
711 .nrprocs = ARRAY_SIZE(nfs4_cb_procedures), 718 .nrprocs = ARRAY_SIZE(nfs4_cb_procedures),
712 .procs = nfs4_cb_procedures 719 .procs = nfs4_cb_procedures,
720 .counts = nfs4_cb_counts,
713}; 721};
714 722
715static const struct rpc_version *nfs_cb_version[] = { 723static const struct rpc_version *nfs_cb_version[] = {
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index dadb3bf305b2..d27e75ad25e3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -344,8 +344,9 @@ copy_clientid(clientid_t *clid, struct nfsd4_session *session)
344 344
345static __be32 345static __be32
346nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 346nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
347 struct nfsd4_open *open) 347 union nfsd4_op_u *u)
348{ 348{
349 struct nfsd4_open *open = &u->open;
349 __be32 status; 350 __be32 status;
350 struct svc_fh *resfh = NULL; 351 struct svc_fh *resfh = NULL;
351 struct net *net = SVC_NET(rqstp); 352 struct net *net = SVC_NET(rqstp);
@@ -467,14 +468,14 @@ out:
467 */ 468 */
468static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_op *op) 469static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_op *op)
469{ 470{
470 struct nfsd4_open *open = (struct nfsd4_open *)&op->u; 471 struct nfsd4_open *open = &op->u.open;
471 472
472 if (!seqid_mutating_err(ntohl(op->status))) 473 if (!seqid_mutating_err(ntohl(op->status)))
473 return op->status; 474 return op->status;
474 if (nfsd4_has_session(cstate)) 475 if (nfsd4_has_session(cstate))
475 return op->status; 476 return op->status;
476 open->op_xdr_error = op->status; 477 open->op_xdr_error = op->status;
477 return nfsd4_open(rqstp, cstate, open); 478 return nfsd4_open(rqstp, cstate, &op->u);
478} 479}
479 480
480/* 481/*
@@ -482,19 +483,21 @@ static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_stat
482 */ 483 */
483static __be32 484static __be32
484nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 485nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
485 struct svc_fh **getfh) 486 union nfsd4_op_u *u)
486{ 487{
487 if (!cstate->current_fh.fh_dentry) 488 if (!cstate->current_fh.fh_dentry)
488 return nfserr_nofilehandle; 489 return nfserr_nofilehandle;
489 490
490 *getfh = &cstate->current_fh; 491 u->getfh = &cstate->current_fh;
491 return nfs_ok; 492 return nfs_ok;
492} 493}
493 494
494static __be32 495static __be32
495nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 496nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
496 struct nfsd4_putfh *putfh) 497 union nfsd4_op_u *u)
497{ 498{
499 struct nfsd4_putfh *putfh = &u->putfh;
500
498 fh_put(&cstate->current_fh); 501 fh_put(&cstate->current_fh);
499 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; 502 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen;
500 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, 503 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval,
@@ -504,7 +507,7 @@ nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
504 507
505static __be32 508static __be32
506nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 509nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
507 void *arg) 510 union nfsd4_op_u *u)
508{ 511{
509 __be32 status; 512 __be32 status;
510 513
@@ -515,7 +518,7 @@ nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
515 518
516static __be32 519static __be32
517nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 520nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
518 void *arg) 521 union nfsd4_op_u *u)
519{ 522{
520 if (!cstate->save_fh.fh_dentry) 523 if (!cstate->save_fh.fh_dentry)
521 return nfserr_restorefh; 524 return nfserr_restorefh;
@@ -530,7 +533,7 @@ nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
530 533
531static __be32 534static __be32
532nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 535nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
533 void *arg) 536 union nfsd4_op_u *u)
534{ 537{
535 if (!cstate->current_fh.fh_dentry) 538 if (!cstate->current_fh.fh_dentry)
536 return nfserr_nofilehandle; 539 return nfserr_nofilehandle;
@@ -548,8 +551,10 @@ nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
548 */ 551 */
549static __be32 552static __be32
550nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 553nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
551 struct nfsd4_access *access) 554 union nfsd4_op_u *u)
552{ 555{
556 struct nfsd4_access *access = &u->access;
557
553 if (access->ac_req_access & ~NFS3_ACCESS_FULL) 558 if (access->ac_req_access & ~NFS3_ACCESS_FULL)
554 return nfserr_inval; 559 return nfserr_inval;
555 560
@@ -574,8 +579,10 @@ static void gen_boot_verifier(nfs4_verifier *verifier, struct net *net)
574 579
575static __be32 580static __be32
576nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 581nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
577 struct nfsd4_commit *commit) 582 union nfsd4_op_u *u)
578{ 583{
584 struct nfsd4_commit *commit = &u->commit;
585
579 gen_boot_verifier(&commit->co_verf, SVC_NET(rqstp)); 586 gen_boot_verifier(&commit->co_verf, SVC_NET(rqstp));
580 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, 587 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset,
581 commit->co_count); 588 commit->co_count);
@@ -583,8 +590,9 @@ nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
583 590
584static __be32 591static __be32
585nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 592nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
586 struct nfsd4_create *create) 593 union nfsd4_op_u *u)
587{ 594{
595 struct nfsd4_create *create = &u->create;
588 struct svc_fh resfh; 596 struct svc_fh resfh;
589 __be32 status; 597 __be32 status;
590 dev_t rdev; 598 dev_t rdev;
@@ -670,8 +678,9 @@ out:
670 678
671static __be32 679static __be32
672nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 680nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
673 struct nfsd4_getattr *getattr) 681 union nfsd4_op_u *u)
674{ 682{
683 struct nfsd4_getattr *getattr = &u->getattr;
675 __be32 status; 684 __be32 status;
676 685
677 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); 686 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP);
@@ -691,8 +700,9 @@ nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
691 700
692static __be32 701static __be32
693nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 702nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
694 struct nfsd4_link *link) 703 union nfsd4_op_u *u)
695{ 704{
705 struct nfsd4_link *link = &u->link;
696 __be32 status = nfserr_nofilehandle; 706 __be32 status = nfserr_nofilehandle;
697 707
698 if (!cstate->save_fh.fh_dentry) 708 if (!cstate->save_fh.fh_dentry)
@@ -723,24 +733,25 @@ static __be32 nfsd4_do_lookupp(struct svc_rqst *rqstp, struct svc_fh *fh)
723 733
724static __be32 734static __be32
725nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 735nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
726 void *arg) 736 union nfsd4_op_u *u)
727{ 737{
728 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); 738 return nfsd4_do_lookupp(rqstp, &cstate->current_fh);
729} 739}
730 740
731static __be32 741static __be32
732nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 742nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
733 struct nfsd4_lookup *lookup) 743 union nfsd4_op_u *u)
734{ 744{
735 return nfsd_lookup(rqstp, &cstate->current_fh, 745 return nfsd_lookup(rqstp, &cstate->current_fh,
736 lookup->lo_name, lookup->lo_len, 746 u->lookup.lo_name, u->lookup.lo_len,
737 &cstate->current_fh); 747 &cstate->current_fh);
738} 748}
739 749
740static __be32 750static __be32
741nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 751nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
742 struct nfsd4_read *read) 752 union nfsd4_op_u *u)
743{ 753{
754 struct nfsd4_read *read = &u->read;
744 __be32 status; 755 __be32 status;
745 756
746 read->rd_filp = NULL; 757 read->rd_filp = NULL;
@@ -775,8 +786,9 @@ out:
775 786
776static __be32 787static __be32
777nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 788nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
778 struct nfsd4_readdir *readdir) 789 union nfsd4_op_u *u)
779{ 790{
791 struct nfsd4_readdir *readdir = &u->readdir;
780 u64 cookie = readdir->rd_cookie; 792 u64 cookie = readdir->rd_cookie;
781 static const nfs4_verifier zeroverf; 793 static const nfs4_verifier zeroverf;
782 794
@@ -800,17 +812,18 @@ nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
800 812
801static __be32 813static __be32
802nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 814nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
803 struct nfsd4_readlink *readlink) 815 union nfsd4_op_u *u)
804{ 816{
805 readlink->rl_rqstp = rqstp; 817 u->readlink.rl_rqstp = rqstp;
806 readlink->rl_fhp = &cstate->current_fh; 818 u->readlink.rl_fhp = &cstate->current_fh;
807 return nfs_ok; 819 return nfs_ok;
808} 820}
809 821
810static __be32 822static __be32
811nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 823nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
812 struct nfsd4_remove *remove) 824 union nfsd4_op_u *u)
813{ 825{
826 struct nfsd4_remove *remove = &u->remove;
814 __be32 status; 827 __be32 status;
815 828
816 if (opens_in_grace(SVC_NET(rqstp))) 829 if (opens_in_grace(SVC_NET(rqstp)))
@@ -826,8 +839,9 @@ nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
826 839
827static __be32 840static __be32
828nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 841nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
829 struct nfsd4_rename *rename) 842 union nfsd4_op_u *u)
830{ 843{
844 struct nfsd4_rename *rename = &u->rename;
831 __be32 status = nfserr_nofilehandle; 845 __be32 status = nfserr_nofilehandle;
832 846
833 if (!cstate->save_fh.fh_dentry) 847 if (!cstate->save_fh.fh_dentry)
@@ -847,8 +861,9 @@ nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
847 861
848static __be32 862static __be32
849nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 863nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
850 struct nfsd4_secinfo *secinfo) 864 union nfsd4_op_u *u)
851{ 865{
866 struct nfsd4_secinfo *secinfo = &u->secinfo;
852 struct svc_export *exp; 867 struct svc_export *exp;
853 struct dentry *dentry; 868 struct dentry *dentry;
854 __be32 err; 869 __be32 err;
@@ -876,11 +891,11 @@ nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
876 891
877static __be32 892static __be32
878nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 893nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
879 struct nfsd4_secinfo_no_name *sin) 894 union nfsd4_op_u *u)
880{ 895{
881 __be32 err; 896 __be32 err;
882 897
883 switch (sin->sin_style) { 898 switch (u->secinfo_no_name.sin_style) {
884 case NFS4_SECINFO_STYLE4_CURRENT_FH: 899 case NFS4_SECINFO_STYLE4_CURRENT_FH:
885 break; 900 break;
886 case NFS4_SECINFO_STYLE4_PARENT: 901 case NFS4_SECINFO_STYLE4_PARENT:
@@ -892,15 +907,16 @@ nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstat
892 return nfserr_inval; 907 return nfserr_inval;
893 } 908 }
894 909
895 sin->sin_exp = exp_get(cstate->current_fh.fh_export); 910 u->secinfo_no_name.sin_exp = exp_get(cstate->current_fh.fh_export);
896 fh_put(&cstate->current_fh); 911 fh_put(&cstate->current_fh);
897 return nfs_ok; 912 return nfs_ok;
898} 913}
899 914
900static __be32 915static __be32
901nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 916nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
902 struct nfsd4_setattr *setattr) 917 union nfsd4_op_u *u)
903{ 918{
919 struct nfsd4_setattr *setattr = &u->setattr;
904 __be32 status = nfs_ok; 920 __be32 status = nfs_ok;
905 int err; 921 int err;
906 922
@@ -960,8 +976,9 @@ static int fill_in_write_vector(struct kvec *vec, struct nfsd4_write *write)
960 976
961static __be32 977static __be32
962nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 978nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
963 struct nfsd4_write *write) 979 union nfsd4_op_u *u)
964{ 980{
981 struct nfsd4_write *write = &u->write;
965 stateid_t *stateid = &write->wr_stateid; 982 stateid_t *stateid = &write->wr_stateid;
966 struct file *filp = NULL; 983 struct file *filp = NULL;
967 __be32 status = nfs_ok; 984 __be32 status = nfs_ok;
@@ -1034,8 +1051,9 @@ out_put_src:
1034 1051
1035static __be32 1052static __be32
1036nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1053nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1037 struct nfsd4_clone *clone) 1054 union nfsd4_op_u *u)
1038{ 1055{
1056 struct nfsd4_clone *clone = &u->clone;
1039 struct file *src, *dst; 1057 struct file *src, *dst;
1040 __be32 status; 1058 __be32 status;
1041 1059
@@ -1055,8 +1073,9 @@ out:
1055 1073
1056static __be32 1074static __be32
1057nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1075nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1058 struct nfsd4_copy *copy) 1076 union nfsd4_op_u *u)
1059{ 1077{
1078 struct nfsd4_copy *copy = &u->copy;
1060 struct file *src, *dst; 1079 struct file *src, *dst;
1061 __be32 status; 1080 __be32 status;
1062 ssize_t bytes; 1081 ssize_t bytes;
@@ -1111,23 +1130,24 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1111 1130
1112static __be32 1131static __be32
1113nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1132nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1114 struct nfsd4_fallocate *fallocate) 1133 union nfsd4_op_u *u)
1115{ 1134{
1116 return nfsd4_fallocate(rqstp, cstate, fallocate, 0); 1135 return nfsd4_fallocate(rqstp, cstate, &u->allocate, 0);
1117} 1136}
1118 1137
1119static __be32 1138static __be32
1120nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1139nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1121 struct nfsd4_fallocate *fallocate) 1140 union nfsd4_op_u *u)
1122{ 1141{
1123 return nfsd4_fallocate(rqstp, cstate, fallocate, 1142 return nfsd4_fallocate(rqstp, cstate, &u->deallocate,
1124 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE); 1143 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE);
1125} 1144}
1126 1145
1127static __be32 1146static __be32
1128nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1147nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1129 struct nfsd4_seek *seek) 1148 union nfsd4_op_u *u)
1130{ 1149{
1150 struct nfsd4_seek *seek = &u->seek;
1131 int whence; 1151 int whence;
1132 __be32 status; 1152 __be32 status;
1133 struct file *file; 1153 struct file *file;
@@ -1232,21 +1252,21 @@ out_kfree:
1232 1252
1233static __be32 1253static __be32
1234nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1254nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1235 struct nfsd4_verify *verify) 1255 union nfsd4_op_u *u)
1236{ 1256{
1237 __be32 status; 1257 __be32 status;
1238 1258
1239 status = _nfsd4_verify(rqstp, cstate, verify); 1259 status = _nfsd4_verify(rqstp, cstate, &u->verify);
1240 return status == nfserr_not_same ? nfs_ok : status; 1260 return status == nfserr_not_same ? nfs_ok : status;
1241} 1261}
1242 1262
1243static __be32 1263static __be32
1244nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1264nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1245 struct nfsd4_verify *verify) 1265 union nfsd4_op_u *u)
1246{ 1266{
1247 __be32 status; 1267 __be32 status;
1248 1268
1249 status = _nfsd4_verify(rqstp, cstate, verify); 1269 status = _nfsd4_verify(rqstp, cstate, &u->nverify);
1250 return status == nfserr_same ? nfs_ok : status; 1270 return status == nfserr_same ? nfs_ok : status;
1251} 1271}
1252 1272
@@ -1271,9 +1291,9 @@ nfsd4_layout_verify(struct svc_export *exp, unsigned int layout_type)
1271 1291
1272static __be32 1292static __be32
1273nfsd4_getdeviceinfo(struct svc_rqst *rqstp, 1293nfsd4_getdeviceinfo(struct svc_rqst *rqstp,
1274 struct nfsd4_compound_state *cstate, 1294 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
1275 struct nfsd4_getdeviceinfo *gdp)
1276{ 1295{
1296 struct nfsd4_getdeviceinfo *gdp = &u->getdeviceinfo;
1277 const struct nfsd4_layout_ops *ops; 1297 const struct nfsd4_layout_ops *ops;
1278 struct nfsd4_deviceid_map *map; 1298 struct nfsd4_deviceid_map *map;
1279 struct svc_export *exp; 1299 struct svc_export *exp;
@@ -1317,9 +1337,9 @@ out:
1317 1337
1318static __be32 1338static __be32
1319nfsd4_layoutget(struct svc_rqst *rqstp, 1339nfsd4_layoutget(struct svc_rqst *rqstp,
1320 struct nfsd4_compound_state *cstate, 1340 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
1321 struct nfsd4_layoutget *lgp)
1322{ 1341{
1342 struct nfsd4_layoutget *lgp = &u->layoutget;
1323 struct svc_fh *current_fh = &cstate->current_fh; 1343 struct svc_fh *current_fh = &cstate->current_fh;
1324 const struct nfsd4_layout_ops *ops; 1344 const struct nfsd4_layout_ops *ops;
1325 struct nfs4_layout_stateid *ls; 1345 struct nfs4_layout_stateid *ls;
@@ -1397,9 +1417,9 @@ out:
1397 1417
1398static __be32 1418static __be32
1399nfsd4_layoutcommit(struct svc_rqst *rqstp, 1419nfsd4_layoutcommit(struct svc_rqst *rqstp,
1400 struct nfsd4_compound_state *cstate, 1420 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
1401 struct nfsd4_layoutcommit *lcp)
1402{ 1421{
1422 struct nfsd4_layoutcommit *lcp = &u->layoutcommit;
1403 const struct nfsd4_layout_seg *seg = &lcp->lc_seg; 1423 const struct nfsd4_layout_seg *seg = &lcp->lc_seg;
1404 struct svc_fh *current_fh = &cstate->current_fh; 1424 struct svc_fh *current_fh = &cstate->current_fh;
1405 const struct nfsd4_layout_ops *ops; 1425 const struct nfsd4_layout_ops *ops;
@@ -1461,9 +1481,9 @@ out:
1461 1481
1462static __be32 1482static __be32
1463nfsd4_layoutreturn(struct svc_rqst *rqstp, 1483nfsd4_layoutreturn(struct svc_rqst *rqstp,
1464 struct nfsd4_compound_state *cstate, 1484 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
1465 struct nfsd4_layoutreturn *lrp)
1466{ 1485{
1486 struct nfsd4_layoutreturn *lrp = &u->layoutreturn;
1467 struct svc_fh *current_fh = &cstate->current_fh; 1487 struct svc_fh *current_fh = &cstate->current_fh;
1468 __be32 nfserr; 1488 __be32 nfserr;
1469 1489
@@ -1510,7 +1530,7 @@ out:
1510 * NULL call. 1530 * NULL call.
1511 */ 1531 */
1512static __be32 1532static __be32
1513nfsd4_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) 1533nfsd4_proc_null(struct svc_rqst *rqstp)
1514{ 1534{
1515 return nfs_ok; 1535 return nfs_ok;
1516} 1536}
@@ -1521,12 +1541,6 @@ static inline void nfsd4_increment_op_stats(u32 opnum)
1521 nfsdstats.nfs4_opcount[opnum]++; 1541 nfsdstats.nfs4_opcount[opnum]++;
1522} 1542}
1523 1543
1524typedef __be32(*nfsd4op_func)(struct svc_rqst *, struct nfsd4_compound_state *,
1525 void *);
1526typedef u32(*nfsd4op_rsize)(struct svc_rqst *, struct nfsd4_op *op);
1527typedef void(*stateid_setter)(struct nfsd4_compound_state *, void *);
1528typedef void(*stateid_getter)(struct nfsd4_compound_state *, void *);
1529
1530enum nfsd4_op_flags { 1544enum nfsd4_op_flags {
1531 ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */ 1545 ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */
1532 ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */ 1546 ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */
@@ -1558,16 +1572,19 @@ enum nfsd4_op_flags {
1558}; 1572};
1559 1573
1560struct nfsd4_operation { 1574struct nfsd4_operation {
1561 nfsd4op_func op_func; 1575 __be32 (*op_func)(struct svc_rqst *, struct nfsd4_compound_state *,
1576 union nfsd4_op_u *);
1562 u32 op_flags; 1577 u32 op_flags;
1563 char *op_name; 1578 char *op_name;
1564 /* Try to get response size before operation */ 1579 /* Try to get response size before operation */
1565 nfsd4op_rsize op_rsize_bop; 1580 u32 (*op_rsize_bop)(struct svc_rqst *, struct nfsd4_op *);
1566 stateid_getter op_get_currentstateid; 1581 void (*op_get_currentstateid)(struct nfsd4_compound_state *,
1567 stateid_setter op_set_currentstateid; 1582 union nfsd4_op_u *);
1583 void (*op_set_currentstateid)(struct nfsd4_compound_state *,
1584 union nfsd4_op_u *);
1568}; 1585};
1569 1586
1570static struct nfsd4_operation nfsd4_ops[]; 1587static const struct nfsd4_operation nfsd4_ops[];
1571 1588
1572static const char *nfsd4_op_name(unsigned opnum); 1589static const char *nfsd4_op_name(unsigned opnum);
1573 1590
@@ -1604,7 +1621,7 @@ static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args)
1604 return nfs_ok; 1621 return nfs_ok;
1605} 1622}
1606 1623
1607static inline struct nfsd4_operation *OPDESC(struct nfsd4_op *op) 1624static inline const struct nfsd4_operation *OPDESC(struct nfsd4_op *op)
1608{ 1625{
1609 return &nfsd4_ops[op->opnum]; 1626 return &nfsd4_ops[op->opnum];
1610} 1627}
@@ -1622,10 +1639,9 @@ static bool need_wrongsec_check(struct svc_rqst *rqstp)
1622 struct nfsd4_compoundargs *argp = rqstp->rq_argp; 1639 struct nfsd4_compoundargs *argp = rqstp->rq_argp;
1623 struct nfsd4_op *this = &argp->ops[resp->opcnt - 1]; 1640 struct nfsd4_op *this = &argp->ops[resp->opcnt - 1];
1624 struct nfsd4_op *next = &argp->ops[resp->opcnt]; 1641 struct nfsd4_op *next = &argp->ops[resp->opcnt];
1625 struct nfsd4_operation *thisd; 1642 const struct nfsd4_operation *thisd = OPDESC(this);
1626 struct nfsd4_operation *nextd; 1643 const struct nfsd4_operation *nextd;
1627 1644
1628 thisd = OPDESC(this);
1629 /* 1645 /*
1630 * Most ops check wronsec on our own; only the putfh-like ops 1646 * Most ops check wronsec on our own; only the putfh-like ops
1631 * have special rules. 1647 * have special rules.
@@ -1673,12 +1689,12 @@ static void svcxdr_init_encode(struct svc_rqst *rqstp,
1673 * COMPOUND call. 1689 * COMPOUND call.
1674 */ 1690 */
1675static __be32 1691static __be32
1676nfsd4_proc_compound(struct svc_rqst *rqstp, 1692nfsd4_proc_compound(struct svc_rqst *rqstp)
1677 struct nfsd4_compoundargs *args,
1678 struct nfsd4_compoundres *resp)
1679{ 1693{
1694 struct nfsd4_compoundargs *args = rqstp->rq_argp;
1695 struct nfsd4_compoundres *resp = rqstp->rq_resp;
1680 struct nfsd4_op *op; 1696 struct nfsd4_op *op;
1681 struct nfsd4_operation *opdesc; 1697 const struct nfsd4_operation *opdesc;
1682 struct nfsd4_compound_state *cstate = &resp->cstate; 1698 struct nfsd4_compound_state *cstate = &resp->cstate;
1683 struct svc_fh *current_fh = &cstate->current_fh; 1699 struct svc_fh *current_fh = &cstate->current_fh;
1684 struct svc_fh *save_fh = &cstate->save_fh; 1700 struct svc_fh *save_fh = &cstate->save_fh;
@@ -2091,360 +2107,360 @@ static inline u32 nfsd4_seek_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
2091 return (op_encode_hdr_size + 3) * sizeof(__be32); 2107 return (op_encode_hdr_size + 3) * sizeof(__be32);
2092} 2108}
2093 2109
2094static struct nfsd4_operation nfsd4_ops[] = { 2110static const struct nfsd4_operation nfsd4_ops[] = {
2095 [OP_ACCESS] = { 2111 [OP_ACCESS] = {
2096 .op_func = (nfsd4op_func)nfsd4_access, 2112 .op_func = nfsd4_access,
2097 .op_name = "OP_ACCESS", 2113 .op_name = "OP_ACCESS",
2098 .op_rsize_bop = (nfsd4op_rsize)nfsd4_access_rsize, 2114 .op_rsize_bop = nfsd4_access_rsize,
2099 }, 2115 },
2100 [OP_CLOSE] = { 2116 [OP_CLOSE] = {
2101 .op_func = (nfsd4op_func)nfsd4_close, 2117 .op_func = nfsd4_close,
2102 .op_flags = OP_MODIFIES_SOMETHING, 2118 .op_flags = OP_MODIFIES_SOMETHING,
2103 .op_name = "OP_CLOSE", 2119 .op_name = "OP_CLOSE",
2104 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, 2120 .op_rsize_bop = nfsd4_status_stateid_rsize,
2105 .op_get_currentstateid = (stateid_getter)nfsd4_get_closestateid, 2121 .op_get_currentstateid = nfsd4_get_closestateid,
2106 .op_set_currentstateid = (stateid_setter)nfsd4_set_closestateid, 2122 .op_set_currentstateid = nfsd4_set_closestateid,
2107 }, 2123 },
2108 [OP_COMMIT] = { 2124 [OP_COMMIT] = {
2109 .op_func = (nfsd4op_func)nfsd4_commit, 2125 .op_func = nfsd4_commit,
2110 .op_flags = OP_MODIFIES_SOMETHING, 2126 .op_flags = OP_MODIFIES_SOMETHING,
2111 .op_name = "OP_COMMIT", 2127 .op_name = "OP_COMMIT",
2112 .op_rsize_bop = (nfsd4op_rsize)nfsd4_commit_rsize, 2128 .op_rsize_bop = nfsd4_commit_rsize,
2113 }, 2129 },
2114 [OP_CREATE] = { 2130 [OP_CREATE] = {
2115 .op_func = (nfsd4op_func)nfsd4_create, 2131 .op_func = nfsd4_create,
2116 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME | OP_CLEAR_STATEID, 2132 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME | OP_CLEAR_STATEID,
2117 .op_name = "OP_CREATE", 2133 .op_name = "OP_CREATE",
2118 .op_rsize_bop = (nfsd4op_rsize)nfsd4_create_rsize, 2134 .op_rsize_bop = nfsd4_create_rsize,
2119 }, 2135 },
2120 [OP_DELEGRETURN] = { 2136 [OP_DELEGRETURN] = {
2121 .op_func = (nfsd4op_func)nfsd4_delegreturn, 2137 .op_func = nfsd4_delegreturn,
2122 .op_flags = OP_MODIFIES_SOMETHING, 2138 .op_flags = OP_MODIFIES_SOMETHING,
2123 .op_name = "OP_DELEGRETURN", 2139 .op_name = "OP_DELEGRETURN",
2124 .op_rsize_bop = nfsd4_only_status_rsize, 2140 .op_rsize_bop = nfsd4_only_status_rsize,
2125 .op_get_currentstateid = (stateid_getter)nfsd4_get_delegreturnstateid, 2141 .op_get_currentstateid = nfsd4_get_delegreturnstateid,
2126 }, 2142 },
2127 [OP_GETATTR] = { 2143 [OP_GETATTR] = {
2128 .op_func = (nfsd4op_func)nfsd4_getattr, 2144 .op_func = nfsd4_getattr,
2129 .op_flags = ALLOWED_ON_ABSENT_FS, 2145 .op_flags = ALLOWED_ON_ABSENT_FS,
2130 .op_rsize_bop = nfsd4_getattr_rsize, 2146 .op_rsize_bop = nfsd4_getattr_rsize,
2131 .op_name = "OP_GETATTR", 2147 .op_name = "OP_GETATTR",
2132 }, 2148 },
2133 [OP_GETFH] = { 2149 [OP_GETFH] = {
2134 .op_func = (nfsd4op_func)nfsd4_getfh, 2150 .op_func = nfsd4_getfh,
2135 .op_name = "OP_GETFH", 2151 .op_name = "OP_GETFH",
2136 .op_rsize_bop = (nfsd4op_rsize)nfsd4_getfh_rsize, 2152 .op_rsize_bop = nfsd4_getfh_rsize,
2137 }, 2153 },
2138 [OP_LINK] = { 2154 [OP_LINK] = {
2139 .op_func = (nfsd4op_func)nfsd4_link, 2155 .op_func = nfsd4_link,
2140 .op_flags = ALLOWED_ON_ABSENT_FS | OP_MODIFIES_SOMETHING 2156 .op_flags = ALLOWED_ON_ABSENT_FS | OP_MODIFIES_SOMETHING
2141 | OP_CACHEME, 2157 | OP_CACHEME,
2142 .op_name = "OP_LINK", 2158 .op_name = "OP_LINK",
2143 .op_rsize_bop = (nfsd4op_rsize)nfsd4_link_rsize, 2159 .op_rsize_bop = nfsd4_link_rsize,
2144 }, 2160 },
2145 [OP_LOCK] = { 2161 [OP_LOCK] = {
2146 .op_func = (nfsd4op_func)nfsd4_lock, 2162 .op_func = nfsd4_lock,
2147 .op_flags = OP_MODIFIES_SOMETHING, 2163 .op_flags = OP_MODIFIES_SOMETHING,
2148 .op_name = "OP_LOCK", 2164 .op_name = "OP_LOCK",
2149 .op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize, 2165 .op_rsize_bop = nfsd4_lock_rsize,
2150 .op_set_currentstateid = (stateid_setter)nfsd4_set_lockstateid, 2166 .op_set_currentstateid = nfsd4_set_lockstateid,
2151 }, 2167 },
2152 [OP_LOCKT] = { 2168 [OP_LOCKT] = {
2153 .op_func = (nfsd4op_func)nfsd4_lockt, 2169 .op_func = nfsd4_lockt,
2154 .op_name = "OP_LOCKT", 2170 .op_name = "OP_LOCKT",
2155 .op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize, 2171 .op_rsize_bop = nfsd4_lock_rsize,
2156 }, 2172 },
2157 [OP_LOCKU] = { 2173 [OP_LOCKU] = {
2158 .op_func = (nfsd4op_func)nfsd4_locku, 2174 .op_func = nfsd4_locku,
2159 .op_flags = OP_MODIFIES_SOMETHING, 2175 .op_flags = OP_MODIFIES_SOMETHING,
2160 .op_name = "OP_LOCKU", 2176 .op_name = "OP_LOCKU",
2161 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, 2177 .op_rsize_bop = nfsd4_status_stateid_rsize,
2162 .op_get_currentstateid = (stateid_getter)nfsd4_get_lockustateid, 2178 .op_get_currentstateid = nfsd4_get_lockustateid,
2163 }, 2179 },
2164 [OP_LOOKUP] = { 2180 [OP_LOOKUP] = {
2165 .op_func = (nfsd4op_func)nfsd4_lookup, 2181 .op_func = nfsd4_lookup,
2166 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID, 2182 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID,
2167 .op_name = "OP_LOOKUP", 2183 .op_name = "OP_LOOKUP",
2168 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2184 .op_rsize_bop = nfsd4_only_status_rsize,
2169 }, 2185 },
2170 [OP_LOOKUPP] = { 2186 [OP_LOOKUPP] = {
2171 .op_func = (nfsd4op_func)nfsd4_lookupp, 2187 .op_func = nfsd4_lookupp,
2172 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID, 2188 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID,
2173 .op_name = "OP_LOOKUPP", 2189 .op_name = "OP_LOOKUPP",
2174 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2190 .op_rsize_bop = nfsd4_only_status_rsize,
2175 }, 2191 },
2176 [OP_NVERIFY] = { 2192 [OP_NVERIFY] = {
2177 .op_func = (nfsd4op_func)nfsd4_nverify, 2193 .op_func = nfsd4_nverify,
2178 .op_name = "OP_NVERIFY", 2194 .op_name = "OP_NVERIFY",
2179 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2195 .op_rsize_bop = nfsd4_only_status_rsize,
2180 }, 2196 },
2181 [OP_OPEN] = { 2197 [OP_OPEN] = {
2182 .op_func = (nfsd4op_func)nfsd4_open, 2198 .op_func = nfsd4_open,
2183 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING, 2199 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING,
2184 .op_name = "OP_OPEN", 2200 .op_name = "OP_OPEN",
2185 .op_rsize_bop = (nfsd4op_rsize)nfsd4_open_rsize, 2201 .op_rsize_bop = nfsd4_open_rsize,
2186 .op_set_currentstateid = (stateid_setter)nfsd4_set_openstateid, 2202 .op_set_currentstateid = nfsd4_set_openstateid,
2187 }, 2203 },
2188 [OP_OPEN_CONFIRM] = { 2204 [OP_OPEN_CONFIRM] = {
2189 .op_func = (nfsd4op_func)nfsd4_open_confirm, 2205 .op_func = nfsd4_open_confirm,
2190 .op_flags = OP_MODIFIES_SOMETHING, 2206 .op_flags = OP_MODIFIES_SOMETHING,
2191 .op_name = "OP_OPEN_CONFIRM", 2207 .op_name = "OP_OPEN_CONFIRM",
2192 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, 2208 .op_rsize_bop = nfsd4_status_stateid_rsize,
2193 }, 2209 },
2194 [OP_OPEN_DOWNGRADE] = { 2210 [OP_OPEN_DOWNGRADE] = {
2195 .op_func = (nfsd4op_func)nfsd4_open_downgrade, 2211 .op_func = nfsd4_open_downgrade,
2196 .op_flags = OP_MODIFIES_SOMETHING, 2212 .op_flags = OP_MODIFIES_SOMETHING,
2197 .op_name = "OP_OPEN_DOWNGRADE", 2213 .op_name = "OP_OPEN_DOWNGRADE",
2198 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, 2214 .op_rsize_bop = nfsd4_status_stateid_rsize,
2199 .op_get_currentstateid = (stateid_getter)nfsd4_get_opendowngradestateid, 2215 .op_get_currentstateid = nfsd4_get_opendowngradestateid,
2200 .op_set_currentstateid = (stateid_setter)nfsd4_set_opendowngradestateid, 2216 .op_set_currentstateid = nfsd4_set_opendowngradestateid,
2201 }, 2217 },
2202 [OP_PUTFH] = { 2218 [OP_PUTFH] = {
2203 .op_func = (nfsd4op_func)nfsd4_putfh, 2219 .op_func = nfsd4_putfh,
2204 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2220 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2205 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2221 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID,
2206 .op_name = "OP_PUTFH", 2222 .op_name = "OP_PUTFH",
2207 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2223 .op_rsize_bop = nfsd4_only_status_rsize,
2208 }, 2224 },
2209 [OP_PUTPUBFH] = { 2225 [OP_PUTPUBFH] = {
2210 .op_func = (nfsd4op_func)nfsd4_putrootfh, 2226 .op_func = nfsd4_putrootfh,
2211 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2227 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2212 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2228 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID,
2213 .op_name = "OP_PUTPUBFH", 2229 .op_name = "OP_PUTPUBFH",
2214 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2230 .op_rsize_bop = nfsd4_only_status_rsize,
2215 }, 2231 },
2216 [OP_PUTROOTFH] = { 2232 [OP_PUTROOTFH] = {
2217 .op_func = (nfsd4op_func)nfsd4_putrootfh, 2233 .op_func = nfsd4_putrootfh,
2218 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2234 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2219 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2235 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID,
2220 .op_name = "OP_PUTROOTFH", 2236 .op_name = "OP_PUTROOTFH",
2221 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2237 .op_rsize_bop = nfsd4_only_status_rsize,
2222 }, 2238 },
2223 [OP_READ] = { 2239 [OP_READ] = {
2224 .op_func = (nfsd4op_func)nfsd4_read, 2240 .op_func = nfsd4_read,
2225 .op_name = "OP_READ", 2241 .op_name = "OP_READ",
2226 .op_rsize_bop = (nfsd4op_rsize)nfsd4_read_rsize, 2242 .op_rsize_bop = nfsd4_read_rsize,
2227 .op_get_currentstateid = (stateid_getter)nfsd4_get_readstateid, 2243 .op_get_currentstateid = nfsd4_get_readstateid,
2228 }, 2244 },
2229 [OP_READDIR] = { 2245 [OP_READDIR] = {
2230 .op_func = (nfsd4op_func)nfsd4_readdir, 2246 .op_func = nfsd4_readdir,
2231 .op_name = "OP_READDIR", 2247 .op_name = "OP_READDIR",
2232 .op_rsize_bop = (nfsd4op_rsize)nfsd4_readdir_rsize, 2248 .op_rsize_bop = nfsd4_readdir_rsize,
2233 }, 2249 },
2234 [OP_READLINK] = { 2250 [OP_READLINK] = {
2235 .op_func = (nfsd4op_func)nfsd4_readlink, 2251 .op_func = nfsd4_readlink,
2236 .op_name = "OP_READLINK", 2252 .op_name = "OP_READLINK",
2237 .op_rsize_bop = (nfsd4op_rsize)nfsd4_readlink_rsize, 2253 .op_rsize_bop = nfsd4_readlink_rsize,
2238 }, 2254 },
2239 [OP_REMOVE] = { 2255 [OP_REMOVE] = {
2240 .op_func = (nfsd4op_func)nfsd4_remove, 2256 .op_func = nfsd4_remove,
2241 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2257 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2242 .op_name = "OP_REMOVE", 2258 .op_name = "OP_REMOVE",
2243 .op_rsize_bop = (nfsd4op_rsize)nfsd4_remove_rsize, 2259 .op_rsize_bop = nfsd4_remove_rsize,
2244 }, 2260 },
2245 [OP_RENAME] = { 2261 [OP_RENAME] = {
2246 .op_func = (nfsd4op_func)nfsd4_rename, 2262 .op_func = nfsd4_rename,
2247 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2263 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2248 .op_name = "OP_RENAME", 2264 .op_name = "OP_RENAME",
2249 .op_rsize_bop = (nfsd4op_rsize)nfsd4_rename_rsize, 2265 .op_rsize_bop = nfsd4_rename_rsize,
2250 }, 2266 },
2251 [OP_RENEW] = { 2267 [OP_RENEW] = {
2252 .op_func = (nfsd4op_func)nfsd4_renew, 2268 .op_func = nfsd4_renew,
2253 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2269 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2254 | OP_MODIFIES_SOMETHING, 2270 | OP_MODIFIES_SOMETHING,
2255 .op_name = "OP_RENEW", 2271 .op_name = "OP_RENEW",
2256 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2272 .op_rsize_bop = nfsd4_only_status_rsize,
2257 2273
2258 }, 2274 },
2259 [OP_RESTOREFH] = { 2275 [OP_RESTOREFH] = {
2260 .op_func = (nfsd4op_func)nfsd4_restorefh, 2276 .op_func = nfsd4_restorefh,
2261 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2277 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2262 | OP_IS_PUTFH_LIKE | OP_MODIFIES_SOMETHING, 2278 | OP_IS_PUTFH_LIKE | OP_MODIFIES_SOMETHING,
2263 .op_name = "OP_RESTOREFH", 2279 .op_name = "OP_RESTOREFH",
2264 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2280 .op_rsize_bop = nfsd4_only_status_rsize,
2265 }, 2281 },
2266 [OP_SAVEFH] = { 2282 [OP_SAVEFH] = {
2267 .op_func = (nfsd4op_func)nfsd4_savefh, 2283 .op_func = nfsd4_savefh,
2268 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING, 2284 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING,
2269 .op_name = "OP_SAVEFH", 2285 .op_name = "OP_SAVEFH",
2270 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2286 .op_rsize_bop = nfsd4_only_status_rsize,
2271 }, 2287 },
2272 [OP_SECINFO] = { 2288 [OP_SECINFO] = {
2273 .op_func = (nfsd4op_func)nfsd4_secinfo, 2289 .op_func = nfsd4_secinfo,
2274 .op_flags = OP_HANDLES_WRONGSEC, 2290 .op_flags = OP_HANDLES_WRONGSEC,
2275 .op_name = "OP_SECINFO", 2291 .op_name = "OP_SECINFO",
2276 .op_rsize_bop = (nfsd4op_rsize)nfsd4_secinfo_rsize, 2292 .op_rsize_bop = nfsd4_secinfo_rsize,
2277 }, 2293 },
2278 [OP_SETATTR] = { 2294 [OP_SETATTR] = {
2279 .op_func = (nfsd4op_func)nfsd4_setattr, 2295 .op_func = nfsd4_setattr,
2280 .op_name = "OP_SETATTR", 2296 .op_name = "OP_SETATTR",
2281 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2297 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2282 .op_rsize_bop = (nfsd4op_rsize)nfsd4_setattr_rsize, 2298 .op_rsize_bop = nfsd4_setattr_rsize,
2283 .op_get_currentstateid = (stateid_getter)nfsd4_get_setattrstateid, 2299 .op_get_currentstateid = nfsd4_get_setattrstateid,
2284 }, 2300 },
2285 [OP_SETCLIENTID] = { 2301 [OP_SETCLIENTID] = {
2286 .op_func = (nfsd4op_func)nfsd4_setclientid, 2302 .op_func = nfsd4_setclientid,
2287 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2303 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2288 | OP_MODIFIES_SOMETHING | OP_CACHEME, 2304 | OP_MODIFIES_SOMETHING | OP_CACHEME,
2289 .op_name = "OP_SETCLIENTID", 2305 .op_name = "OP_SETCLIENTID",
2290 .op_rsize_bop = (nfsd4op_rsize)nfsd4_setclientid_rsize, 2306 .op_rsize_bop = nfsd4_setclientid_rsize,
2291 }, 2307 },
2292 [OP_SETCLIENTID_CONFIRM] = { 2308 [OP_SETCLIENTID_CONFIRM] = {
2293 .op_func = (nfsd4op_func)nfsd4_setclientid_confirm, 2309 .op_func = nfsd4_setclientid_confirm,
2294 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2310 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2295 | OP_MODIFIES_SOMETHING | OP_CACHEME, 2311 | OP_MODIFIES_SOMETHING | OP_CACHEME,
2296 .op_name = "OP_SETCLIENTID_CONFIRM", 2312 .op_name = "OP_SETCLIENTID_CONFIRM",
2297 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2313 .op_rsize_bop = nfsd4_only_status_rsize,
2298 }, 2314 },
2299 [OP_VERIFY] = { 2315 [OP_VERIFY] = {
2300 .op_func = (nfsd4op_func)nfsd4_verify, 2316 .op_func = nfsd4_verify,
2301 .op_name = "OP_VERIFY", 2317 .op_name = "OP_VERIFY",
2302 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2318 .op_rsize_bop = nfsd4_only_status_rsize,
2303 }, 2319 },
2304 [OP_WRITE] = { 2320 [OP_WRITE] = {
2305 .op_func = (nfsd4op_func)nfsd4_write, 2321 .op_func = nfsd4_write,
2306 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2322 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2307 .op_name = "OP_WRITE", 2323 .op_name = "OP_WRITE",
2308 .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, 2324 .op_rsize_bop = nfsd4_write_rsize,
2309 .op_get_currentstateid = (stateid_getter)nfsd4_get_writestateid, 2325 .op_get_currentstateid = nfsd4_get_writestateid,
2310 }, 2326 },
2311 [OP_RELEASE_LOCKOWNER] = { 2327 [OP_RELEASE_LOCKOWNER] = {
2312 .op_func = (nfsd4op_func)nfsd4_release_lockowner, 2328 .op_func = nfsd4_release_lockowner,
2313 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2329 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS
2314 | OP_MODIFIES_SOMETHING, 2330 | OP_MODIFIES_SOMETHING,
2315 .op_name = "OP_RELEASE_LOCKOWNER", 2331 .op_name = "OP_RELEASE_LOCKOWNER",
2316 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2332 .op_rsize_bop = nfsd4_only_status_rsize,
2317 }, 2333 },
2318 2334
2319 /* NFSv4.1 operations */ 2335 /* NFSv4.1 operations */
2320 [OP_EXCHANGE_ID] = { 2336 [OP_EXCHANGE_ID] = {
2321 .op_func = (nfsd4op_func)nfsd4_exchange_id, 2337 .op_func = nfsd4_exchange_id,
2322 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2338 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP
2323 | OP_MODIFIES_SOMETHING, 2339 | OP_MODIFIES_SOMETHING,
2324 .op_name = "OP_EXCHANGE_ID", 2340 .op_name = "OP_EXCHANGE_ID",
2325 .op_rsize_bop = (nfsd4op_rsize)nfsd4_exchange_id_rsize, 2341 .op_rsize_bop = nfsd4_exchange_id_rsize,
2326 }, 2342 },
2327 [OP_BACKCHANNEL_CTL] = { 2343 [OP_BACKCHANNEL_CTL] = {
2328 .op_func = (nfsd4op_func)nfsd4_backchannel_ctl, 2344 .op_func = nfsd4_backchannel_ctl,
2329 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2345 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING,
2330 .op_name = "OP_BACKCHANNEL_CTL", 2346 .op_name = "OP_BACKCHANNEL_CTL",
2331 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2347 .op_rsize_bop = nfsd4_only_status_rsize,
2332 }, 2348 },
2333 [OP_BIND_CONN_TO_SESSION] = { 2349 [OP_BIND_CONN_TO_SESSION] = {
2334 .op_func = (nfsd4op_func)nfsd4_bind_conn_to_session, 2350 .op_func = nfsd4_bind_conn_to_session,
2335 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2351 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP
2336 | OP_MODIFIES_SOMETHING, 2352 | OP_MODIFIES_SOMETHING,
2337 .op_name = "OP_BIND_CONN_TO_SESSION", 2353 .op_name = "OP_BIND_CONN_TO_SESSION",
2338 .op_rsize_bop = (nfsd4op_rsize)nfsd4_bind_conn_to_session_rsize, 2354 .op_rsize_bop = nfsd4_bind_conn_to_session_rsize,
2339 }, 2355 },
2340 [OP_CREATE_SESSION] = { 2356 [OP_CREATE_SESSION] = {
2341 .op_func = (nfsd4op_func)nfsd4_create_session, 2357 .op_func = nfsd4_create_session,
2342 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2358 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP
2343 | OP_MODIFIES_SOMETHING, 2359 | OP_MODIFIES_SOMETHING,
2344 .op_name = "OP_CREATE_SESSION", 2360 .op_name = "OP_CREATE_SESSION",
2345 .op_rsize_bop = (nfsd4op_rsize)nfsd4_create_session_rsize, 2361 .op_rsize_bop = nfsd4_create_session_rsize,
2346 }, 2362 },
2347 [OP_DESTROY_SESSION] = { 2363 [OP_DESTROY_SESSION] = {
2348 .op_func = (nfsd4op_func)nfsd4_destroy_session, 2364 .op_func = nfsd4_destroy_session,
2349 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2365 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP
2350 | OP_MODIFIES_SOMETHING, 2366 | OP_MODIFIES_SOMETHING,
2351 .op_name = "OP_DESTROY_SESSION", 2367 .op_name = "OP_DESTROY_SESSION",
2352 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2368 .op_rsize_bop = nfsd4_only_status_rsize,
2353 }, 2369 },
2354 [OP_SEQUENCE] = { 2370 [OP_SEQUENCE] = {
2355 .op_func = (nfsd4op_func)nfsd4_sequence, 2371 .op_func = nfsd4_sequence,
2356 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP, 2372 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
2357 .op_name = "OP_SEQUENCE", 2373 .op_name = "OP_SEQUENCE",
2358 .op_rsize_bop = (nfsd4op_rsize)nfsd4_sequence_rsize, 2374 .op_rsize_bop = nfsd4_sequence_rsize,
2359 }, 2375 },
2360 [OP_DESTROY_CLIENTID] = { 2376 [OP_DESTROY_CLIENTID] = {
2361 .op_func = (nfsd4op_func)nfsd4_destroy_clientid, 2377 .op_func = nfsd4_destroy_clientid,
2362 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2378 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP
2363 | OP_MODIFIES_SOMETHING, 2379 | OP_MODIFIES_SOMETHING,
2364 .op_name = "OP_DESTROY_CLIENTID", 2380 .op_name = "OP_DESTROY_CLIENTID",
2365 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2381 .op_rsize_bop = nfsd4_only_status_rsize,
2366 }, 2382 },
2367 [OP_RECLAIM_COMPLETE] = { 2383 [OP_RECLAIM_COMPLETE] = {
2368 .op_func = (nfsd4op_func)nfsd4_reclaim_complete, 2384 .op_func = nfsd4_reclaim_complete,
2369 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2385 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING,
2370 .op_name = "OP_RECLAIM_COMPLETE", 2386 .op_name = "OP_RECLAIM_COMPLETE",
2371 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2387 .op_rsize_bop = nfsd4_only_status_rsize,
2372 }, 2388 },
2373 [OP_SECINFO_NO_NAME] = { 2389 [OP_SECINFO_NO_NAME] = {
2374 .op_func = (nfsd4op_func)nfsd4_secinfo_no_name, 2390 .op_func = nfsd4_secinfo_no_name,
2375 .op_flags = OP_HANDLES_WRONGSEC, 2391 .op_flags = OP_HANDLES_WRONGSEC,
2376 .op_name = "OP_SECINFO_NO_NAME", 2392 .op_name = "OP_SECINFO_NO_NAME",
2377 .op_rsize_bop = (nfsd4op_rsize)nfsd4_secinfo_rsize, 2393 .op_rsize_bop = nfsd4_secinfo_rsize,
2378 }, 2394 },
2379 [OP_TEST_STATEID] = { 2395 [OP_TEST_STATEID] = {
2380 .op_func = (nfsd4op_func)nfsd4_test_stateid, 2396 .op_func = nfsd4_test_stateid,
2381 .op_flags = ALLOWED_WITHOUT_FH, 2397 .op_flags = ALLOWED_WITHOUT_FH,
2382 .op_name = "OP_TEST_STATEID", 2398 .op_name = "OP_TEST_STATEID",
2383 .op_rsize_bop = (nfsd4op_rsize)nfsd4_test_stateid_rsize, 2399 .op_rsize_bop = nfsd4_test_stateid_rsize,
2384 }, 2400 },
2385 [OP_FREE_STATEID] = { 2401 [OP_FREE_STATEID] = {
2386 .op_func = (nfsd4op_func)nfsd4_free_stateid, 2402 .op_func = nfsd4_free_stateid,
2387 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2403 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING,
2388 .op_name = "OP_FREE_STATEID", 2404 .op_name = "OP_FREE_STATEID",
2389 .op_get_currentstateid = (stateid_getter)nfsd4_get_freestateid, 2405 .op_get_currentstateid = nfsd4_get_freestateid,
2390 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2406 .op_rsize_bop = nfsd4_only_status_rsize,
2391 }, 2407 },
2392#ifdef CONFIG_NFSD_PNFS 2408#ifdef CONFIG_NFSD_PNFS
2393 [OP_GETDEVICEINFO] = { 2409 [OP_GETDEVICEINFO] = {
2394 .op_func = (nfsd4op_func)nfsd4_getdeviceinfo, 2410 .op_func = nfsd4_getdeviceinfo,
2395 .op_flags = ALLOWED_WITHOUT_FH, 2411 .op_flags = ALLOWED_WITHOUT_FH,
2396 .op_name = "OP_GETDEVICEINFO", 2412 .op_name = "OP_GETDEVICEINFO",
2397 .op_rsize_bop = (nfsd4op_rsize)nfsd4_getdeviceinfo_rsize, 2413 .op_rsize_bop = nfsd4_getdeviceinfo_rsize,
2398 }, 2414 },
2399 [OP_LAYOUTGET] = { 2415 [OP_LAYOUTGET] = {
2400 .op_func = (nfsd4op_func)nfsd4_layoutget, 2416 .op_func = nfsd4_layoutget,
2401 .op_flags = OP_MODIFIES_SOMETHING, 2417 .op_flags = OP_MODIFIES_SOMETHING,
2402 .op_name = "OP_LAYOUTGET", 2418 .op_name = "OP_LAYOUTGET",
2403 .op_rsize_bop = (nfsd4op_rsize)nfsd4_layoutget_rsize, 2419 .op_rsize_bop = nfsd4_layoutget_rsize,
2404 }, 2420 },
2405 [OP_LAYOUTCOMMIT] = { 2421 [OP_LAYOUTCOMMIT] = {
2406 .op_func = (nfsd4op_func)nfsd4_layoutcommit, 2422 .op_func = nfsd4_layoutcommit,
2407 .op_flags = OP_MODIFIES_SOMETHING, 2423 .op_flags = OP_MODIFIES_SOMETHING,
2408 .op_name = "OP_LAYOUTCOMMIT", 2424 .op_name = "OP_LAYOUTCOMMIT",
2409 .op_rsize_bop = (nfsd4op_rsize)nfsd4_layoutcommit_rsize, 2425 .op_rsize_bop = nfsd4_layoutcommit_rsize,
2410 }, 2426 },
2411 [OP_LAYOUTRETURN] = { 2427 [OP_LAYOUTRETURN] = {
2412 .op_func = (nfsd4op_func)nfsd4_layoutreturn, 2428 .op_func = nfsd4_layoutreturn,
2413 .op_flags = OP_MODIFIES_SOMETHING, 2429 .op_flags = OP_MODIFIES_SOMETHING,
2414 .op_name = "OP_LAYOUTRETURN", 2430 .op_name = "OP_LAYOUTRETURN",
2415 .op_rsize_bop = (nfsd4op_rsize)nfsd4_layoutreturn_rsize, 2431 .op_rsize_bop = nfsd4_layoutreturn_rsize,
2416 }, 2432 },
2417#endif /* CONFIG_NFSD_PNFS */ 2433#endif /* CONFIG_NFSD_PNFS */
2418 2434
2419 /* NFSv4.2 operations */ 2435 /* NFSv4.2 operations */
2420 [OP_ALLOCATE] = { 2436 [OP_ALLOCATE] = {
2421 .op_func = (nfsd4op_func)nfsd4_allocate, 2437 .op_func = nfsd4_allocate,
2422 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2438 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2423 .op_name = "OP_ALLOCATE", 2439 .op_name = "OP_ALLOCATE",
2424 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2440 .op_rsize_bop = nfsd4_only_status_rsize,
2425 }, 2441 },
2426 [OP_DEALLOCATE] = { 2442 [OP_DEALLOCATE] = {
2427 .op_func = (nfsd4op_func)nfsd4_deallocate, 2443 .op_func = nfsd4_deallocate,
2428 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2444 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2429 .op_name = "OP_DEALLOCATE", 2445 .op_name = "OP_DEALLOCATE",
2430 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2446 .op_rsize_bop = nfsd4_only_status_rsize,
2431 }, 2447 },
2432 [OP_CLONE] = { 2448 [OP_CLONE] = {
2433 .op_func = (nfsd4op_func)nfsd4_clone, 2449 .op_func = nfsd4_clone,
2434 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2450 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2435 .op_name = "OP_CLONE", 2451 .op_name = "OP_CLONE",
2436 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 2452 .op_rsize_bop = nfsd4_only_status_rsize,
2437 }, 2453 },
2438 [OP_COPY] = { 2454 [OP_COPY] = {
2439 .op_func = (nfsd4op_func)nfsd4_copy, 2455 .op_func = nfsd4_copy,
2440 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2456 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
2441 .op_name = "OP_COPY", 2457 .op_name = "OP_COPY",
2442 .op_rsize_bop = (nfsd4op_rsize)nfsd4_copy_rsize, 2458 .op_rsize_bop = nfsd4_copy_rsize,
2443 }, 2459 },
2444 [OP_SEEK] = { 2460 [OP_SEEK] = {
2445 .op_func = (nfsd4op_func)nfsd4_seek, 2461 .op_func = nfsd4_seek,
2446 .op_name = "OP_SEEK", 2462 .op_name = "OP_SEEK",
2447 .op_rsize_bop = (nfsd4op_rsize)nfsd4_seek_rsize, 2463 .op_rsize_bop = nfsd4_seek_rsize,
2448 }, 2464 },
2449}; 2465};
2450 2466
@@ -2515,19 +2531,19 @@ static const char *nfsd4_op_name(unsigned opnum)
2515#define nfsd4_voidres nfsd4_voidargs 2531#define nfsd4_voidres nfsd4_voidargs
2516struct nfsd4_voidargs { int dummy; }; 2532struct nfsd4_voidargs { int dummy; };
2517 2533
2518static struct svc_procedure nfsd_procedures4[2] = { 2534static const struct svc_procedure nfsd_procedures4[2] = {
2519 [NFSPROC4_NULL] = { 2535 [NFSPROC4_NULL] = {
2520 .pc_func = (svc_procfunc) nfsd4_proc_null, 2536 .pc_func = nfsd4_proc_null,
2521 .pc_encode = (kxdrproc_t) nfs4svc_encode_voidres, 2537 .pc_encode = nfs4svc_encode_voidres,
2522 .pc_argsize = sizeof(struct nfsd4_voidargs), 2538 .pc_argsize = sizeof(struct nfsd4_voidargs),
2523 .pc_ressize = sizeof(struct nfsd4_voidres), 2539 .pc_ressize = sizeof(struct nfsd4_voidres),
2524 .pc_cachetype = RC_NOCACHE, 2540 .pc_cachetype = RC_NOCACHE,
2525 .pc_xdrressize = 1, 2541 .pc_xdrressize = 1,
2526 }, 2542 },
2527 [NFSPROC4_COMPOUND] = { 2543 [NFSPROC4_COMPOUND] = {
2528 .pc_func = (svc_procfunc) nfsd4_proc_compound, 2544 .pc_func = nfsd4_proc_compound,
2529 .pc_decode = (kxdrproc_t) nfs4svc_decode_compoundargs, 2545 .pc_decode = nfs4svc_decode_compoundargs,
2530 .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, 2546 .pc_encode = nfs4svc_encode_compoundres,
2531 .pc_argsize = sizeof(struct nfsd4_compoundargs), 2547 .pc_argsize = sizeof(struct nfsd4_compoundargs),
2532 .pc_ressize = sizeof(struct nfsd4_compoundres), 2548 .pc_ressize = sizeof(struct nfsd4_compoundres),
2533 .pc_release = nfsd4_release_compoundargs, 2549 .pc_release = nfsd4_release_compoundargs,
@@ -2536,10 +2552,12 @@ static struct svc_procedure nfsd_procedures4[2] = {
2536 }, 2552 },
2537}; 2553};
2538 2554
2539struct svc_version nfsd_version4 = { 2555static unsigned int nfsd_count3[ARRAY_SIZE(nfsd_procedures4)];
2556const struct svc_version nfsd_version4 = {
2540 .vs_vers = 4, 2557 .vs_vers = 4,
2541 .vs_nproc = 2, 2558 .vs_nproc = 2,
2542 .vs_proc = nfsd_procedures4, 2559 .vs_proc = nfsd_procedures4,
2560 .vs_count = nfsd_count3,
2543 .vs_dispatch = nfsd_dispatch, 2561 .vs_dispatch = nfsd_dispatch,
2544 .vs_xdrsize = NFS4_SVC_XDRSIZE, 2562 .vs_xdrsize = NFS4_SVC_XDRSIZE,
2545 .vs_rpcb_optnl = true, 2563 .vs_rpcb_optnl = true,
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 22002fb75a18..0c04f81aa63b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2402,10 +2402,10 @@ static bool client_has_state(struct nfs4_client *clp)
2402} 2402}
2403 2403
2404__be32 2404__be32
2405nfsd4_exchange_id(struct svc_rqst *rqstp, 2405nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2406 struct nfsd4_compound_state *cstate, 2406 union nfsd4_op_u *u)
2407 struct nfsd4_exchange_id *exid)
2408{ 2407{
2408 struct nfsd4_exchange_id *exid = &u->exchange_id;
2409 struct nfs4_client *conf, *new; 2409 struct nfs4_client *conf, *new;
2410 struct nfs4_client *unconf = NULL; 2410 struct nfs4_client *unconf = NULL;
2411 __be32 status; 2411 __be32 status;
@@ -2698,9 +2698,9 @@ static __be32 nfsd4_check_cb_sec(struct nfsd4_cb_sec *cbs)
2698 2698
2699__be32 2699__be32
2700nfsd4_create_session(struct svc_rqst *rqstp, 2700nfsd4_create_session(struct svc_rqst *rqstp,
2701 struct nfsd4_compound_state *cstate, 2701 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
2702 struct nfsd4_create_session *cr_ses)
2703{ 2702{
2703 struct nfsd4_create_session *cr_ses = &u->create_session;
2704 struct sockaddr *sa = svc_addr(rqstp); 2704 struct sockaddr *sa = svc_addr(rqstp);
2705 struct nfs4_client *conf, *unconf; 2705 struct nfs4_client *conf, *unconf;
2706 struct nfs4_client *old = NULL; 2706 struct nfs4_client *old = NULL;
@@ -2824,8 +2824,11 @@ static __be32 nfsd4_map_bcts_dir(u32 *dir)
2824 return nfserr_inval; 2824 return nfserr_inval;
2825} 2825}
2826 2826
2827__be32 nfsd4_backchannel_ctl(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_backchannel_ctl *bc) 2827__be32 nfsd4_backchannel_ctl(struct svc_rqst *rqstp,
2828 struct nfsd4_compound_state *cstate,
2829 union nfsd4_op_u *u)
2828{ 2830{
2831 struct nfsd4_backchannel_ctl *bc = &u->backchannel_ctl;
2829 struct nfsd4_session *session = cstate->session; 2832 struct nfsd4_session *session = cstate->session;
2830 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 2833 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
2831 __be32 status; 2834 __be32 status;
@@ -2845,8 +2848,9 @@ __be32 nfsd4_backchannel_ctl(struct svc_rqst *rqstp, struct nfsd4_compound_state
2845 2848
2846__be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, 2849__be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
2847 struct nfsd4_compound_state *cstate, 2850 struct nfsd4_compound_state *cstate,
2848 struct nfsd4_bind_conn_to_session *bcts) 2851 union nfsd4_op_u *u)
2849{ 2852{
2853 struct nfsd4_bind_conn_to_session *bcts = &u->bind_conn_to_session;
2850 __be32 status; 2854 __be32 status;
2851 struct nfsd4_conn *conn; 2855 struct nfsd4_conn *conn;
2852 struct nfsd4_session *session; 2856 struct nfsd4_session *session;
@@ -2886,10 +2890,10 @@ static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4
2886} 2890}
2887 2891
2888__be32 2892__be32
2889nfsd4_destroy_session(struct svc_rqst *r, 2893nfsd4_destroy_session(struct svc_rqst *r, struct nfsd4_compound_state *cstate,
2890 struct nfsd4_compound_state *cstate, 2894 union nfsd4_op_u *u)
2891 struct nfsd4_destroy_session *sessionid)
2892{ 2895{
2896 struct nfsd4_destroy_session *sessionid = &u->destroy_session;
2893 struct nfsd4_session *ses; 2897 struct nfsd4_session *ses;
2894 __be32 status; 2898 __be32 status;
2895 int ref_held_by_me = 0; 2899 int ref_held_by_me = 0;
@@ -2983,10 +2987,10 @@ static bool nfsd4_request_too_big(struct svc_rqst *rqstp,
2983} 2987}
2984 2988
2985__be32 2989__be32
2986nfsd4_sequence(struct svc_rqst *rqstp, 2990nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
2987 struct nfsd4_compound_state *cstate, 2991 union nfsd4_op_u *u)
2988 struct nfsd4_sequence *seq)
2989{ 2992{
2993 struct nfsd4_sequence *seq = &u->sequence;
2990 struct nfsd4_compoundres *resp = rqstp->rq_resp; 2994 struct nfsd4_compoundres *resp = rqstp->rq_resp;
2991 struct xdr_stream *xdr = &resp->xdr; 2995 struct xdr_stream *xdr = &resp->xdr;
2992 struct nfsd4_session *session; 2996 struct nfsd4_session *session;
@@ -3120,8 +3124,11 @@ nfsd4_sequence_done(struct nfsd4_compoundres *resp)
3120} 3124}
3121 3125
3122__be32 3126__be32
3123nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) 3127nfsd4_destroy_clientid(struct svc_rqst *rqstp,
3128 struct nfsd4_compound_state *cstate,
3129 union nfsd4_op_u *u)
3124{ 3130{
3131 struct nfsd4_destroy_clientid *dc = &u->destroy_clientid;
3125 struct nfs4_client *conf, *unconf; 3132 struct nfs4_client *conf, *unconf;
3126 struct nfs4_client *clp = NULL; 3133 struct nfs4_client *clp = NULL;
3127 __be32 status = 0; 3134 __be32 status = 0;
@@ -3161,8 +3168,10 @@ out:
3161} 3168}
3162 3169
3163__be32 3170__be32
3164nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) 3171nfsd4_reclaim_complete(struct svc_rqst *rqstp,
3172 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
3165{ 3173{
3174 struct nfsd4_reclaim_complete *rc = &u->reclaim_complete;
3166 __be32 status = 0; 3175 __be32 status = 0;
3167 3176
3168 if (rc->rca_one_fs) { 3177 if (rc->rca_one_fs) {
@@ -3199,8 +3208,9 @@ out:
3199 3208
3200__be32 3209__be32
3201nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 3210nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3202 struct nfsd4_setclientid *setclid) 3211 union nfsd4_op_u *u)
3203{ 3212{
3213 struct nfsd4_setclientid *setclid = &u->setclientid;
3204 struct xdr_netobj clname = setclid->se_name; 3214 struct xdr_netobj clname = setclid->se_name;
3205 nfs4_verifier clverifier = setclid->se_verf; 3215 nfs4_verifier clverifier = setclid->se_verf;
3206 struct nfs4_client *conf, *new; 3216 struct nfs4_client *conf, *new;
@@ -3257,9 +3267,11 @@ out:
3257 3267
3258__be32 3268__be32
3259nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 3269nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
3260 struct nfsd4_compound_state *cstate, 3270 struct nfsd4_compound_state *cstate,
3261 struct nfsd4_setclientid_confirm *setclientid_confirm) 3271 union nfsd4_op_u *u)
3262{ 3272{
3273 struct nfsd4_setclientid_confirm *setclientid_confirm =
3274 &u->setclientid_confirm;
3263 struct nfs4_client *conf, *unconf; 3275 struct nfs4_client *conf, *unconf;
3264 struct nfs4_client *old = NULL; 3276 struct nfs4_client *old = NULL;
3265 nfs4_verifier confirm = setclientid_confirm->sc_confirm; 3277 nfs4_verifier confirm = setclientid_confirm->sc_confirm;
@@ -4506,8 +4518,9 @@ void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate,
4506 4518
4507__be32 4519__be32
4508nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 4520nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
4509 clientid_t *clid) 4521 union nfsd4_op_u *u)
4510{ 4522{
4523 clientid_t *clid = &u->renew;
4511 struct nfs4_client *clp; 4524 struct nfs4_client *clp;
4512 __be32 status; 4525 __be32 status;
4513 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 4526 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
@@ -4993,8 +5006,9 @@ out:
4993 */ 5006 */
4994__be32 5007__be32
4995nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5008nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
4996 struct nfsd4_test_stateid *test_stateid) 5009 union nfsd4_op_u *u)
4997{ 5010{
5011 struct nfsd4_test_stateid *test_stateid = &u->test_stateid;
4998 struct nfsd4_test_stateid_id *stateid; 5012 struct nfsd4_test_stateid_id *stateid;
4999 struct nfs4_client *cl = cstate->session->se_client; 5013 struct nfs4_client *cl = cstate->session->se_client;
5000 5014
@@ -5033,8 +5047,9 @@ out:
5033 5047
5034__be32 5048__be32
5035nfsd4_free_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5049nfsd4_free_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5036 struct nfsd4_free_stateid *free_stateid) 5050 union nfsd4_op_u *u)
5037{ 5051{
5052 struct nfsd4_free_stateid *free_stateid = &u->free_stateid;
5038 stateid_t *stateid = &free_stateid->fr_stateid; 5053 stateid_t *stateid = &free_stateid->fr_stateid;
5039 struct nfs4_stid *s; 5054 struct nfs4_stid *s;
5040 struct nfs4_delegation *dp; 5055 struct nfs4_delegation *dp;
@@ -5162,8 +5177,9 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cs
5162 5177
5163__be32 5178__be32
5164nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5179nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5165 struct nfsd4_open_confirm *oc) 5180 union nfsd4_op_u *u)
5166{ 5181{
5182 struct nfsd4_open_confirm *oc = &u->open_confirm;
5167 __be32 status; 5183 __be32 status;
5168 struct nfs4_openowner *oo; 5184 struct nfs4_openowner *oo;
5169 struct nfs4_ol_stateid *stp; 5185 struct nfs4_ol_stateid *stp;
@@ -5230,9 +5246,9 @@ static inline void nfs4_stateid_downgrade(struct nfs4_ol_stateid *stp, u32 to_ac
5230 5246
5231__be32 5247__be32
5232nfsd4_open_downgrade(struct svc_rqst *rqstp, 5248nfsd4_open_downgrade(struct svc_rqst *rqstp,
5233 struct nfsd4_compound_state *cstate, 5249 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
5234 struct nfsd4_open_downgrade *od)
5235{ 5250{
5251 struct nfsd4_open_downgrade *od = &u->open_downgrade;
5236 __be32 status; 5252 __be32 status;
5237 struct nfs4_ol_stateid *stp; 5253 struct nfs4_ol_stateid *stp;
5238 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 5254 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
@@ -5300,8 +5316,9 @@ static void nfsd4_close_open_stateid(struct nfs4_ol_stateid *s)
5300 */ 5316 */
5301__be32 5317__be32
5302nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5318nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5303 struct nfsd4_close *close) 5319 union nfsd4_op_u *u)
5304{ 5320{
5321 struct nfsd4_close *close = &u->close;
5305 __be32 status; 5322 __be32 status;
5306 struct nfs4_ol_stateid *stp; 5323 struct nfs4_ol_stateid *stp;
5307 struct net *net = SVC_NET(rqstp); 5324 struct net *net = SVC_NET(rqstp);
@@ -5330,8 +5347,9 @@ out:
5330 5347
5331__be32 5348__be32
5332nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5349nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5333 struct nfsd4_delegreturn *dr) 5350 union nfsd4_op_u *u)
5334{ 5351{
5352 struct nfsd4_delegreturn *dr = &u->delegreturn;
5335 struct nfs4_delegation *dp; 5353 struct nfs4_delegation *dp;
5336 stateid_t *stateid = &dr->dr_stateid; 5354 stateid_t *stateid = &dr->dr_stateid;
5337 struct nfs4_stid *s; 5355 struct nfs4_stid *s;
@@ -5706,8 +5724,9 @@ out:
5706 */ 5724 */
5707__be32 5725__be32
5708nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5726nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5709 struct nfsd4_lock *lock) 5727 union nfsd4_op_u *u)
5710{ 5728{
5729 struct nfsd4_lock *lock = &u->lock;
5711 struct nfs4_openowner *open_sop = NULL; 5730 struct nfs4_openowner *open_sop = NULL;
5712 struct nfs4_lockowner *lock_sop = NULL; 5731 struct nfs4_lockowner *lock_sop = NULL;
5713 struct nfs4_ol_stateid *lock_stp = NULL; 5732 struct nfs4_ol_stateid *lock_stp = NULL;
@@ -5939,8 +5958,9 @@ static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct
5939 */ 5958 */
5940__be32 5959__be32
5941nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5960nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5942 struct nfsd4_lockt *lockt) 5961 union nfsd4_op_u *u)
5943{ 5962{
5963 struct nfsd4_lockt *lockt = &u->lockt;
5944 struct file_lock *file_lock = NULL; 5964 struct file_lock *file_lock = NULL;
5945 struct nfs4_lockowner *lo = NULL; 5965 struct nfs4_lockowner *lo = NULL;
5946 __be32 status; 5966 __be32 status;
@@ -6012,8 +6032,9 @@ out:
6012 6032
6013__be32 6033__be32
6014nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 6034nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
6015 struct nfsd4_locku *locku) 6035 union nfsd4_op_u *u)
6016{ 6036{
6037 struct nfsd4_locku *locku = &u->locku;
6017 struct nfs4_ol_stateid *stp; 6038 struct nfs4_ol_stateid *stp;
6018 struct file *filp = NULL; 6039 struct file *filp = NULL;
6019 struct file_lock *file_lock = NULL; 6040 struct file_lock *file_lock = NULL;
@@ -6119,8 +6140,9 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)
6119__be32 6140__be32
6120nfsd4_release_lockowner(struct svc_rqst *rqstp, 6141nfsd4_release_lockowner(struct svc_rqst *rqstp,
6121 struct nfsd4_compound_state *cstate, 6142 struct nfsd4_compound_state *cstate,
6122 struct nfsd4_release_lockowner *rlockowner) 6143 union nfsd4_op_u *u)
6123{ 6144{
6145 struct nfsd4_release_lockowner *rlockowner = &u->release_lockowner;
6124 clientid_t *clid = &rlockowner->rl_clientid; 6146 clientid_t *clid = &rlockowner->rl_clientid;
6125 struct nfs4_stateowner *sop; 6147 struct nfs4_stateowner *sop;
6126 struct nfs4_lockowner *lo = NULL; 6148 struct nfs4_lockowner *lo = NULL;
@@ -7103,27 +7125,31 @@ clear_current_stateid(struct nfsd4_compound_state *cstate)
7103 * functions to set current state id 7125 * functions to set current state id
7104 */ 7126 */
7105void 7127void
7106nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp) 7128nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate,
7129 union nfsd4_op_u *u)
7107{ 7130{
7108 put_stateid(cstate, &odp->od_stateid); 7131 put_stateid(cstate, &u->open_downgrade.od_stateid);
7109} 7132}
7110 7133
7111void 7134void
7112nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) 7135nfsd4_set_openstateid(struct nfsd4_compound_state *cstate,
7136 union nfsd4_op_u *u)
7113{ 7137{
7114 put_stateid(cstate, &open->op_stateid); 7138 put_stateid(cstate, &u->open.op_stateid);
7115} 7139}
7116 7140
7117void 7141void
7118nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) 7142nfsd4_set_closestateid(struct nfsd4_compound_state *cstate,
7143 union nfsd4_op_u *u)
7119{ 7144{
7120 put_stateid(cstate, &close->cl_stateid); 7145 put_stateid(cstate, &u->close.cl_stateid);
7121} 7146}
7122 7147
7123void 7148void
7124nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lock) 7149nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate,
7150 union nfsd4_op_u *u)
7125{ 7151{
7126 put_stateid(cstate, &lock->lk_resp_stateid); 7152 put_stateid(cstate, &u->lock.lk_resp_stateid);
7127} 7153}
7128 7154
7129/* 7155/*
@@ -7131,49 +7157,57 @@ nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lo
7131 */ 7157 */
7132 7158
7133void 7159void
7134nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp) 7160nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate,
7161 union nfsd4_op_u *u)
7135{ 7162{
7136 get_stateid(cstate, &odp->od_stateid); 7163 get_stateid(cstate, &u->open_downgrade.od_stateid);
7137} 7164}
7138 7165
7139void 7166void
7140nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *cstate, struct nfsd4_delegreturn *drp) 7167nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *cstate,
7168 union nfsd4_op_u *u)
7141{ 7169{
7142 get_stateid(cstate, &drp->dr_stateid); 7170 get_stateid(cstate, &u->delegreturn.dr_stateid);
7143} 7171}
7144 7172
7145void 7173void
7146nfsd4_get_freestateid(struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp) 7174nfsd4_get_freestateid(struct nfsd4_compound_state *cstate,
7175 union nfsd4_op_u *u)
7147{ 7176{
7148 get_stateid(cstate, &fsp->fr_stateid); 7177 get_stateid(cstate, &u->free_stateid.fr_stateid);
7149} 7178}
7150 7179
7151void 7180void
7152nfsd4_get_setattrstateid(struct nfsd4_compound_state *cstate, struct nfsd4_setattr *setattr) 7181nfsd4_get_setattrstateid(struct nfsd4_compound_state *cstate,
7182 union nfsd4_op_u *u)
7153{ 7183{
7154 get_stateid(cstate, &setattr->sa_stateid); 7184 get_stateid(cstate, &u->setattr.sa_stateid);
7155} 7185}
7156 7186
7157void 7187void
7158nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) 7188nfsd4_get_closestateid(struct nfsd4_compound_state *cstate,
7189 union nfsd4_op_u *u)
7159{ 7190{
7160 get_stateid(cstate, &close->cl_stateid); 7191 get_stateid(cstate, &u->close.cl_stateid);
7161} 7192}
7162 7193
7163void 7194void
7164nfsd4_get_lockustateid(struct nfsd4_compound_state *cstate, struct nfsd4_locku *locku) 7195nfsd4_get_lockustateid(struct nfsd4_compound_state *cstate,
7196 union nfsd4_op_u *u)
7165{ 7197{
7166 get_stateid(cstate, &locku->lu_stateid); 7198 get_stateid(cstate, &u->locku.lu_stateid);
7167} 7199}
7168 7200
7169void 7201void
7170nfsd4_get_readstateid(struct nfsd4_compound_state *cstate, struct nfsd4_read *read) 7202nfsd4_get_readstateid(struct nfsd4_compound_state *cstate,
7203 union nfsd4_op_u *u)
7171{ 7204{
7172 get_stateid(cstate, &read->rd_stateid); 7205 get_stateid(cstate, &u->read.rd_stateid);
7173} 7206}
7174 7207
7175void 7208void
7176nfsd4_get_writestateid(struct nfsd4_compound_state *cstate, struct nfsd4_write *write) 7209nfsd4_get_writestateid(struct nfsd4_compound_state *cstate,
7210 union nfsd4_op_u *u)
7177{ 7211{
7178 get_stateid(cstate, &write->wr_stateid); 7212 get_stateid(cstate, &u->write.wr_stateid);
7179} 7213}
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 26780d53a6f9..20fbcab97753 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1973,7 +1973,7 @@ static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode,
1973 *p++ = cpu_to_be32(convert_to_wallclock(exp->cd->flush_time)); 1973 *p++ = cpu_to_be32(convert_to_wallclock(exp->cd->flush_time));
1974 *p++ = 0; 1974 *p++ = 0;
1975 } else if (IS_I_VERSION(inode)) { 1975 } else if (IS_I_VERSION(inode)) {
1976 p = xdr_encode_hyper(p, inode->i_version); 1976 p = xdr_encode_hyper(p, nfsd4_change_attribute(inode));
1977 } else { 1977 } else {
1978 *p++ = cpu_to_be32(stat->ctime.tv_sec); 1978 *p++ = cpu_to_be32(stat->ctime.tv_sec);
1979 *p++ = cpu_to_be32(stat->ctime.tv_nsec); 1979 *p++ = cpu_to_be32(stat->ctime.tv_nsec);
@@ -4538,14 +4538,13 @@ nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op)
4538} 4538}
4539 4539
4540int 4540int
4541nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 4541nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
4542{ 4542{
4543 return xdr_ressize_check(rqstp, p); 4543 return xdr_ressize_check(rqstp, p);
4544} 4544}
4545 4545
4546int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp) 4546void nfsd4_release_compoundargs(struct svc_rqst *rqstp)
4547{ 4547{
4548 struct svc_rqst *rqstp = rq;
4549 struct nfsd4_compoundargs *args = rqstp->rq_argp; 4548 struct nfsd4_compoundargs *args = rqstp->rq_argp;
4550 4549
4551 if (args->ops != args->iops) { 4550 if (args->ops != args->iops) {
@@ -4559,12 +4558,13 @@ int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp)
4559 args->to_free = tb->next; 4558 args->to_free = tb->next;
4560 kfree(tb); 4559 kfree(tb);
4561 } 4560 }
4562 return 1;
4563} 4561}
4564 4562
4565int 4563int
4566nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args) 4564nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p)
4567{ 4565{
4566 struct nfsd4_compoundargs *args = rqstp->rq_argp;
4567
4568 if (rqstp->rq_arg.head[0].iov_len % 4) { 4568 if (rqstp->rq_arg.head[0].iov_len % 4) {
4569 /* client is nuts */ 4569 /* client is nuts */
4570 dprintk("%s: compound not properly padded! (peeraddr=%pISc xid=0x%x)", 4570 dprintk("%s: compound not properly padded! (peeraddr=%pISc xid=0x%x)",
@@ -4584,11 +4584,12 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_comp
4584} 4584}
4585 4585
4586int 4586int
4587nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundres *resp) 4587nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p)
4588{ 4588{
4589 /* 4589 /*
4590 * All that remains is to write the tag and operation count... 4590 * All that remains is to write the tag and operation count...
4591 */ 4591 */
4592 struct nfsd4_compoundres *resp = rqstp->rq_resp;
4592 struct xdr_buf *buf = resp->xdr.buf; 4593 struct xdr_buf *buf = resp->xdr.buf;
4593 4594
4594 WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len + 4595 WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index d96606801d47..b9c538ab7a59 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -60,7 +60,7 @@ struct readdir_cd {
60 60
61 61
62extern struct svc_program nfsd_program; 62extern struct svc_program nfsd_program;
63extern struct svc_version nfsd_version2, nfsd_version3, 63extern const struct svc_version nfsd_version2, nfsd_version3,
64 nfsd_version4; 64 nfsd_version4;
65extern struct mutex nfsd_mutex; 65extern struct mutex nfsd_mutex;
66extern spinlock_t nfsd_drc_lock; 66extern spinlock_t nfsd_drc_lock;
@@ -86,12 +86,12 @@ void nfsd_destroy(struct net *net);
86 86
87#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 87#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
88#ifdef CONFIG_NFSD_V2_ACL 88#ifdef CONFIG_NFSD_V2_ACL
89extern struct svc_version nfsd_acl_version2; 89extern const struct svc_version nfsd_acl_version2;
90#else 90#else
91#define nfsd_acl_version2 NULL 91#define nfsd_acl_version2 NULL
92#endif 92#endif
93#ifdef CONFIG_NFSD_V3_ACL 93#ifdef CONFIG_NFSD_V3_ACL
94extern struct svc_version nfsd_acl_version3; 94extern const struct svc_version nfsd_acl_version3;
95#else 95#else
96#define nfsd_acl_version3 NULL 96#define nfsd_acl_version3 NULL
97#endif 97#endif
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h
index f84fe6bf9aee..e47cf6c2ac28 100644
--- a/fs/nfsd/nfsfh.h
+++ b/fs/nfsd/nfsfh.h
@@ -241,6 +241,28 @@ fh_clear_wcc(struct svc_fh *fhp)
241} 241}
242 242
243/* 243/*
244 * We could use i_version alone as the change attribute. However,
245 * i_version can go backwards after a reboot. On its own that doesn't
246 * necessarily cause a problem, but if i_version goes backwards and then
247 * is incremented again it could reuse a value that was previously used
248 * before boot, and a client who queried the two values might
249 * incorrectly assume nothing changed.
250 *
251 * By using both ctime and the i_version counter we guarantee that as
252 * long as time doesn't go backwards we never reuse an old value.
253 */
254static inline u64 nfsd4_change_attribute(struct inode *inode)
255{
256 u64 chattr;
257
258 chattr = inode->i_ctime.tv_sec;
259 chattr <<= 30;
260 chattr += inode->i_ctime.tv_nsec;
261 chattr += inode->i_version;
262 return chattr;
263}
264
265/*
244 * Fill in the pre_op attr for the wcc data 266 * Fill in the pre_op attr for the wcc data
245 */ 267 */
246static inline void 268static inline void
@@ -253,7 +275,7 @@ fill_pre_wcc(struct svc_fh *fhp)
253 fhp->fh_pre_mtime = inode->i_mtime; 275 fhp->fh_pre_mtime = inode->i_mtime;
254 fhp->fh_pre_ctime = inode->i_ctime; 276 fhp->fh_pre_ctime = inode->i_ctime;
255 fhp->fh_pre_size = inode->i_size; 277 fhp->fh_pre_size = inode->i_size;
256 fhp->fh_pre_change = inode->i_version; 278 fhp->fh_pre_change = nfsd4_change_attribute(inode);
257 fhp->fh_pre_saved = true; 279 fhp->fh_pre_saved = true;
258 } 280 }
259} 281}
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 03a7e9da4da0..5076ae2b8258 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -17,7 +17,7 @@ typedef struct svc_buf svc_buf;
17 17
18 18
19static __be32 19static __be32
20nfsd_proc_null(struct svc_rqst *rqstp, void *argp, void *resp) 20nfsd_proc_null(struct svc_rqst *rqstp)
21{ 21{
22 return nfs_ok; 22 return nfs_ok;
23} 23}
@@ -39,9 +39,10 @@ nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
39 * N.B. After this call resp->fh needs an fh_put 39 * N.B. After this call resp->fh needs an fh_put
40 */ 40 */
41static __be32 41static __be32
42nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp, 42nfsd_proc_getattr(struct svc_rqst *rqstp)
43 struct nfsd_attrstat *resp)
44{ 43{
44 struct nfsd_fhandle *argp = rqstp->rq_argp;
45 struct nfsd_attrstat *resp = rqstp->rq_resp;
45 __be32 nfserr; 46 __be32 nfserr;
46 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh)); 47 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
47 48
@@ -56,9 +57,10 @@ nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
56 * N.B. After this call resp->fh needs an fh_put 57 * N.B. After this call resp->fh needs an fh_put
57 */ 58 */
58static __be32 59static __be32
59nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp, 60nfsd_proc_setattr(struct svc_rqst *rqstp)
60 struct nfsd_attrstat *resp)
61{ 61{
62 struct nfsd_sattrargs *argp = rqstp->rq_argp;
63 struct nfsd_attrstat *resp = rqstp->rq_resp;
62 struct iattr *iap = &argp->attrs; 64 struct iattr *iap = &argp->attrs;
63 struct svc_fh *fhp; 65 struct svc_fh *fhp;
64 __be32 nfserr; 66 __be32 nfserr;
@@ -122,9 +124,10 @@ done:
122 * N.B. After this call resp->fh needs an fh_put 124 * N.B. After this call resp->fh needs an fh_put
123 */ 125 */
124static __be32 126static __be32
125nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp, 127nfsd_proc_lookup(struct svc_rqst *rqstp)
126 struct nfsd_diropres *resp)
127{ 128{
129 struct nfsd_diropargs *argp = rqstp->rq_argp;
130 struct nfsd_diropres *resp = rqstp->rq_resp;
128 __be32 nfserr; 131 __be32 nfserr;
129 132
130 dprintk("nfsd: LOOKUP %s %.*s\n", 133 dprintk("nfsd: LOOKUP %s %.*s\n",
@@ -142,9 +145,10 @@ nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
142 * Read a symlink. 145 * Read a symlink.
143 */ 146 */
144static __be32 147static __be32
145nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp, 148nfsd_proc_readlink(struct svc_rqst *rqstp)
146 struct nfsd_readlinkres *resp)
147{ 149{
150 struct nfsd_readlinkargs *argp = rqstp->rq_argp;
151 struct nfsd_readlinkres *resp = rqstp->rq_resp;
148 __be32 nfserr; 152 __be32 nfserr;
149 153
150 dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh)); 154 dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
@@ -162,9 +166,10 @@ nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp,
162 * N.B. After this call resp->fh needs an fh_put 166 * N.B. After this call resp->fh needs an fh_put
163 */ 167 */
164static __be32 168static __be32
165nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp, 169nfsd_proc_read(struct svc_rqst *rqstp)
166 struct nfsd_readres *resp)
167{ 170{
171 struct nfsd_readargs *argp = rqstp->rq_argp;
172 struct nfsd_readres *resp = rqstp->rq_resp;
168 __be32 nfserr; 173 __be32 nfserr;
169 174
170 dprintk("nfsd: READ %s %d bytes at %d\n", 175 dprintk("nfsd: READ %s %d bytes at %d\n",
@@ -200,9 +205,10 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
200 * N.B. After this call resp->fh needs an fh_put 205 * N.B. After this call resp->fh needs an fh_put
201 */ 206 */
202static __be32 207static __be32
203nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp, 208nfsd_proc_write(struct svc_rqst *rqstp)
204 struct nfsd_attrstat *resp)
205{ 209{
210 struct nfsd_writeargs *argp = rqstp->rq_argp;
211 struct nfsd_attrstat *resp = rqstp->rq_resp;
206 __be32 nfserr; 212 __be32 nfserr;
207 unsigned long cnt = argp->len; 213 unsigned long cnt = argp->len;
208 214
@@ -222,9 +228,10 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
222 * N.B. After this call _both_ argp->fh and resp->fh need an fh_put 228 * N.B. After this call _both_ argp->fh and resp->fh need an fh_put
223 */ 229 */
224static __be32 230static __be32
225nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp, 231nfsd_proc_create(struct svc_rqst *rqstp)
226 struct nfsd_diropres *resp)
227{ 232{
233 struct nfsd_createargs *argp = rqstp->rq_argp;
234 struct nfsd_diropres *resp = rqstp->rq_resp;
228 svc_fh *dirfhp = &argp->fh; 235 svc_fh *dirfhp = &argp->fh;
229 svc_fh *newfhp = &resp->fh; 236 svc_fh *newfhp = &resp->fh;
230 struct iattr *attr = &argp->attrs; 237 struct iattr *attr = &argp->attrs;
@@ -377,9 +384,9 @@ done:
377} 384}
378 385
379static __be32 386static __be32
380nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp, 387nfsd_proc_remove(struct svc_rqst *rqstp)
381 void *resp)
382{ 388{
389 struct nfsd_diropargs *argp = rqstp->rq_argp;
383 __be32 nfserr; 390 __be32 nfserr;
384 391
385 dprintk("nfsd: REMOVE %s %.*s\n", SVCFH_fmt(&argp->fh), 392 dprintk("nfsd: REMOVE %s %.*s\n", SVCFH_fmt(&argp->fh),
@@ -392,9 +399,9 @@ nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
392} 399}
393 400
394static __be32 401static __be32
395nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp, 402nfsd_proc_rename(struct svc_rqst *rqstp)
396 void *resp)
397{ 403{
404 struct nfsd_renameargs *argp = rqstp->rq_argp;
398 __be32 nfserr; 405 __be32 nfserr;
399 406
400 dprintk("nfsd: RENAME %s %.*s -> \n", 407 dprintk("nfsd: RENAME %s %.*s -> \n",
@@ -410,9 +417,9 @@ nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp,
410} 417}
411 418
412static __be32 419static __be32
413nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp, 420nfsd_proc_link(struct svc_rqst *rqstp)
414 void *resp)
415{ 421{
422 struct nfsd_linkargs *argp = rqstp->rq_argp;
416 __be32 nfserr; 423 __be32 nfserr;
417 424
418 dprintk("nfsd: LINK %s ->\n", 425 dprintk("nfsd: LINK %s ->\n",
@@ -430,9 +437,9 @@ nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp,
430} 437}
431 438
432static __be32 439static __be32
433nfsd_proc_symlink(struct svc_rqst *rqstp, struct nfsd_symlinkargs *argp, 440nfsd_proc_symlink(struct svc_rqst *rqstp)
434 void *resp)
435{ 441{
442 struct nfsd_symlinkargs *argp = rqstp->rq_argp;
436 struct svc_fh newfh; 443 struct svc_fh newfh;
437 __be32 nfserr; 444 __be32 nfserr;
438 445
@@ -460,9 +467,10 @@ nfsd_proc_symlink(struct svc_rqst *rqstp, struct nfsd_symlinkargs *argp,
460 * N.B. After this call resp->fh needs an fh_put 467 * N.B. After this call resp->fh needs an fh_put
461 */ 468 */
462static __be32 469static __be32
463nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp, 470nfsd_proc_mkdir(struct svc_rqst *rqstp)
464 struct nfsd_diropres *resp)
465{ 471{
472 struct nfsd_createargs *argp = rqstp->rq_argp;
473 struct nfsd_diropres *resp = rqstp->rq_resp;
466 __be32 nfserr; 474 __be32 nfserr;
467 475
468 dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name); 476 dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
@@ -484,9 +492,9 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
484 * Remove a directory 492 * Remove a directory
485 */ 493 */
486static __be32 494static __be32
487nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp, 495nfsd_proc_rmdir(struct svc_rqst *rqstp)
488 void *resp)
489{ 496{
497 struct nfsd_diropargs *argp = rqstp->rq_argp;
490 __be32 nfserr; 498 __be32 nfserr;
491 499
492 dprintk("nfsd: RMDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name); 500 dprintk("nfsd: RMDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
@@ -500,9 +508,10 @@ nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
500 * Read a portion of a directory. 508 * Read a portion of a directory.
501 */ 509 */
502static __be32 510static __be32
503nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp, 511nfsd_proc_readdir(struct svc_rqst *rqstp)
504 struct nfsd_readdirres *resp)
505{ 512{
513 struct nfsd_readdirargs *argp = rqstp->rq_argp;
514 struct nfsd_readdirres *resp = rqstp->rq_resp;
506 int count; 515 int count;
507 __be32 nfserr; 516 __be32 nfserr;
508 loff_t offset; 517 loff_t offset;
@@ -540,9 +549,10 @@ nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
540 * Get file system info 549 * Get file system info
541 */ 550 */
542static __be32 551static __be32
543nfsd_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle *argp, 552nfsd_proc_statfs(struct svc_rqst *rqstp)
544 struct nfsd_statfsres *resp)
545{ 553{
554 struct nfsd_fhandle *argp = rqstp->rq_argp;
555 struct nfsd_statfsres *resp = rqstp->rq_resp;
546 __be32 nfserr; 556 __be32 nfserr;
547 557
548 dprintk("nfsd: STATFS %s\n", SVCFH_fmt(&argp->fh)); 558 dprintk("nfsd: STATFS %s\n", SVCFH_fmt(&argp->fh));
@@ -563,168 +573,168 @@ struct nfsd_void { int dummy; };
563#define FH 8 /* filehandle */ 573#define FH 8 /* filehandle */
564#define AT 18 /* attributes */ 574#define AT 18 /* attributes */
565 575
566static struct svc_procedure nfsd_procedures2[18] = { 576static const struct svc_procedure nfsd_procedures2[18] = {
567 [NFSPROC_NULL] = { 577 [NFSPROC_NULL] = {
568 .pc_func = (svc_procfunc) nfsd_proc_null, 578 .pc_func = nfsd_proc_null,
569 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 579 .pc_decode = nfssvc_decode_void,
570 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 580 .pc_encode = nfssvc_encode_void,
571 .pc_argsize = sizeof(struct nfsd_void), 581 .pc_argsize = sizeof(struct nfsd_void),
572 .pc_ressize = sizeof(struct nfsd_void), 582 .pc_ressize = sizeof(struct nfsd_void),
573 .pc_cachetype = RC_NOCACHE, 583 .pc_cachetype = RC_NOCACHE,
574 .pc_xdrressize = ST, 584 .pc_xdrressize = ST,
575 }, 585 },
576 [NFSPROC_GETATTR] = { 586 [NFSPROC_GETATTR] = {
577 .pc_func = (svc_procfunc) nfsd_proc_getattr, 587 .pc_func = nfsd_proc_getattr,
578 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle, 588 .pc_decode = nfssvc_decode_fhandle,
579 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 589 .pc_encode = nfssvc_encode_attrstat,
580 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 590 .pc_release = nfssvc_release_fhandle,
581 .pc_argsize = sizeof(struct nfsd_fhandle), 591 .pc_argsize = sizeof(struct nfsd_fhandle),
582 .pc_ressize = sizeof(struct nfsd_attrstat), 592 .pc_ressize = sizeof(struct nfsd_attrstat),
583 .pc_cachetype = RC_NOCACHE, 593 .pc_cachetype = RC_NOCACHE,
584 .pc_xdrressize = ST+AT, 594 .pc_xdrressize = ST+AT,
585 }, 595 },
586 [NFSPROC_SETATTR] = { 596 [NFSPROC_SETATTR] = {
587 .pc_func = (svc_procfunc) nfsd_proc_setattr, 597 .pc_func = nfsd_proc_setattr,
588 .pc_decode = (kxdrproc_t) nfssvc_decode_sattrargs, 598 .pc_decode = nfssvc_decode_sattrargs,
589 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 599 .pc_encode = nfssvc_encode_attrstat,
590 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 600 .pc_release = nfssvc_release_fhandle,
591 .pc_argsize = sizeof(struct nfsd_sattrargs), 601 .pc_argsize = sizeof(struct nfsd_sattrargs),
592 .pc_ressize = sizeof(struct nfsd_attrstat), 602 .pc_ressize = sizeof(struct nfsd_attrstat),
593 .pc_cachetype = RC_REPLBUFF, 603 .pc_cachetype = RC_REPLBUFF,
594 .pc_xdrressize = ST+AT, 604 .pc_xdrressize = ST+AT,
595 }, 605 },
596 [NFSPROC_ROOT] = { 606 [NFSPROC_ROOT] = {
597 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 607 .pc_decode = nfssvc_decode_void,
598 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 608 .pc_encode = nfssvc_encode_void,
599 .pc_argsize = sizeof(struct nfsd_void), 609 .pc_argsize = sizeof(struct nfsd_void),
600 .pc_ressize = sizeof(struct nfsd_void), 610 .pc_ressize = sizeof(struct nfsd_void),
601 .pc_cachetype = RC_NOCACHE, 611 .pc_cachetype = RC_NOCACHE,
602 .pc_xdrressize = ST, 612 .pc_xdrressize = ST,
603 }, 613 },
604 [NFSPROC_LOOKUP] = { 614 [NFSPROC_LOOKUP] = {
605 .pc_func = (svc_procfunc) nfsd_proc_lookup, 615 .pc_func = nfsd_proc_lookup,
606 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 616 .pc_decode = nfssvc_decode_diropargs,
607 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 617 .pc_encode = nfssvc_encode_diropres,
608 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 618 .pc_release = nfssvc_release_fhandle,
609 .pc_argsize = sizeof(struct nfsd_diropargs), 619 .pc_argsize = sizeof(struct nfsd_diropargs),
610 .pc_ressize = sizeof(struct nfsd_diropres), 620 .pc_ressize = sizeof(struct nfsd_diropres),
611 .pc_cachetype = RC_NOCACHE, 621 .pc_cachetype = RC_NOCACHE,
612 .pc_xdrressize = ST+FH+AT, 622 .pc_xdrressize = ST+FH+AT,
613 }, 623 },
614 [NFSPROC_READLINK] = { 624 [NFSPROC_READLINK] = {
615 .pc_func = (svc_procfunc) nfsd_proc_readlink, 625 .pc_func = nfsd_proc_readlink,
616 .pc_decode = (kxdrproc_t) nfssvc_decode_readlinkargs, 626 .pc_decode = nfssvc_decode_readlinkargs,
617 .pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres, 627 .pc_encode = nfssvc_encode_readlinkres,
618 .pc_argsize = sizeof(struct nfsd_readlinkargs), 628 .pc_argsize = sizeof(struct nfsd_readlinkargs),
619 .pc_ressize = sizeof(struct nfsd_readlinkres), 629 .pc_ressize = sizeof(struct nfsd_readlinkres),
620 .pc_cachetype = RC_NOCACHE, 630 .pc_cachetype = RC_NOCACHE,
621 .pc_xdrressize = ST+1+NFS_MAXPATHLEN/4, 631 .pc_xdrressize = ST+1+NFS_MAXPATHLEN/4,
622 }, 632 },
623 [NFSPROC_READ] = { 633 [NFSPROC_READ] = {
624 .pc_func = (svc_procfunc) nfsd_proc_read, 634 .pc_func = nfsd_proc_read,
625 .pc_decode = (kxdrproc_t) nfssvc_decode_readargs, 635 .pc_decode = nfssvc_decode_readargs,
626 .pc_encode = (kxdrproc_t) nfssvc_encode_readres, 636 .pc_encode = nfssvc_encode_readres,
627 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 637 .pc_release = nfssvc_release_fhandle,
628 .pc_argsize = sizeof(struct nfsd_readargs), 638 .pc_argsize = sizeof(struct nfsd_readargs),
629 .pc_ressize = sizeof(struct nfsd_readres), 639 .pc_ressize = sizeof(struct nfsd_readres),
630 .pc_cachetype = RC_NOCACHE, 640 .pc_cachetype = RC_NOCACHE,
631 .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4, 641 .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4,
632 }, 642 },
633 [NFSPROC_WRITECACHE] = { 643 [NFSPROC_WRITECACHE] = {
634 .pc_decode = (kxdrproc_t) nfssvc_decode_void, 644 .pc_decode = nfssvc_decode_void,
635 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 645 .pc_encode = nfssvc_encode_void,
636 .pc_argsize = sizeof(struct nfsd_void), 646 .pc_argsize = sizeof(struct nfsd_void),
637 .pc_ressize = sizeof(struct nfsd_void), 647 .pc_ressize = sizeof(struct nfsd_void),
638 .pc_cachetype = RC_NOCACHE, 648 .pc_cachetype = RC_NOCACHE,
639 .pc_xdrressize = ST, 649 .pc_xdrressize = ST,
640 }, 650 },
641 [NFSPROC_WRITE] = { 651 [NFSPROC_WRITE] = {
642 .pc_func = (svc_procfunc) nfsd_proc_write, 652 .pc_func = nfsd_proc_write,
643 .pc_decode = (kxdrproc_t) nfssvc_decode_writeargs, 653 .pc_decode = nfssvc_decode_writeargs,
644 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 654 .pc_encode = nfssvc_encode_attrstat,
645 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 655 .pc_release = nfssvc_release_fhandle,
646 .pc_argsize = sizeof(struct nfsd_writeargs), 656 .pc_argsize = sizeof(struct nfsd_writeargs),
647 .pc_ressize = sizeof(struct nfsd_attrstat), 657 .pc_ressize = sizeof(struct nfsd_attrstat),
648 .pc_cachetype = RC_REPLBUFF, 658 .pc_cachetype = RC_REPLBUFF,
649 .pc_xdrressize = ST+AT, 659 .pc_xdrressize = ST+AT,
650 }, 660 },
651 [NFSPROC_CREATE] = { 661 [NFSPROC_CREATE] = {
652 .pc_func = (svc_procfunc) nfsd_proc_create, 662 .pc_func = nfsd_proc_create,
653 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs, 663 .pc_decode = nfssvc_decode_createargs,
654 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 664 .pc_encode = nfssvc_encode_diropres,
655 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 665 .pc_release = nfssvc_release_fhandle,
656 .pc_argsize = sizeof(struct nfsd_createargs), 666 .pc_argsize = sizeof(struct nfsd_createargs),
657 .pc_ressize = sizeof(struct nfsd_diropres), 667 .pc_ressize = sizeof(struct nfsd_diropres),
658 .pc_cachetype = RC_REPLBUFF, 668 .pc_cachetype = RC_REPLBUFF,
659 .pc_xdrressize = ST+FH+AT, 669 .pc_xdrressize = ST+FH+AT,
660 }, 670 },
661 [NFSPROC_REMOVE] = { 671 [NFSPROC_REMOVE] = {
662 .pc_func = (svc_procfunc) nfsd_proc_remove, 672 .pc_func = nfsd_proc_remove,
663 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 673 .pc_decode = nfssvc_decode_diropargs,
664 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 674 .pc_encode = nfssvc_encode_void,
665 .pc_argsize = sizeof(struct nfsd_diropargs), 675 .pc_argsize = sizeof(struct nfsd_diropargs),
666 .pc_ressize = sizeof(struct nfsd_void), 676 .pc_ressize = sizeof(struct nfsd_void),
667 .pc_cachetype = RC_REPLSTAT, 677 .pc_cachetype = RC_REPLSTAT,
668 .pc_xdrressize = ST, 678 .pc_xdrressize = ST,
669 }, 679 },
670 [NFSPROC_RENAME] = { 680 [NFSPROC_RENAME] = {
671 .pc_func = (svc_procfunc) nfsd_proc_rename, 681 .pc_func = nfsd_proc_rename,
672 .pc_decode = (kxdrproc_t) nfssvc_decode_renameargs, 682 .pc_decode = nfssvc_decode_renameargs,
673 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 683 .pc_encode = nfssvc_encode_void,
674 .pc_argsize = sizeof(struct nfsd_renameargs), 684 .pc_argsize = sizeof(struct nfsd_renameargs),
675 .pc_ressize = sizeof(struct nfsd_void), 685 .pc_ressize = sizeof(struct nfsd_void),
676 .pc_cachetype = RC_REPLSTAT, 686 .pc_cachetype = RC_REPLSTAT,
677 .pc_xdrressize = ST, 687 .pc_xdrressize = ST,
678 }, 688 },
679 [NFSPROC_LINK] = { 689 [NFSPROC_LINK] = {
680 .pc_func = (svc_procfunc) nfsd_proc_link, 690 .pc_func = nfsd_proc_link,
681 .pc_decode = (kxdrproc_t) nfssvc_decode_linkargs, 691 .pc_decode = nfssvc_decode_linkargs,
682 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 692 .pc_encode = nfssvc_encode_void,
683 .pc_argsize = sizeof(struct nfsd_linkargs), 693 .pc_argsize = sizeof(struct nfsd_linkargs),
684 .pc_ressize = sizeof(struct nfsd_void), 694 .pc_ressize = sizeof(struct nfsd_void),
685 .pc_cachetype = RC_REPLSTAT, 695 .pc_cachetype = RC_REPLSTAT,
686 .pc_xdrressize = ST, 696 .pc_xdrressize = ST,
687 }, 697 },
688 [NFSPROC_SYMLINK] = { 698 [NFSPROC_SYMLINK] = {
689 .pc_func = (svc_procfunc) nfsd_proc_symlink, 699 .pc_func = nfsd_proc_symlink,
690 .pc_decode = (kxdrproc_t) nfssvc_decode_symlinkargs, 700 .pc_decode = nfssvc_decode_symlinkargs,
691 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 701 .pc_encode = nfssvc_encode_void,
692 .pc_argsize = sizeof(struct nfsd_symlinkargs), 702 .pc_argsize = sizeof(struct nfsd_symlinkargs),
693 .pc_ressize = sizeof(struct nfsd_void), 703 .pc_ressize = sizeof(struct nfsd_void),
694 .pc_cachetype = RC_REPLSTAT, 704 .pc_cachetype = RC_REPLSTAT,
695 .pc_xdrressize = ST, 705 .pc_xdrressize = ST,
696 }, 706 },
697 [NFSPROC_MKDIR] = { 707 [NFSPROC_MKDIR] = {
698 .pc_func = (svc_procfunc) nfsd_proc_mkdir, 708 .pc_func = nfsd_proc_mkdir,
699 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs, 709 .pc_decode = nfssvc_decode_createargs,
700 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 710 .pc_encode = nfssvc_encode_diropres,
701 .pc_release = (kxdrproc_t) nfssvc_release_fhandle, 711 .pc_release = nfssvc_release_fhandle,
702 .pc_argsize = sizeof(struct nfsd_createargs), 712 .pc_argsize = sizeof(struct nfsd_createargs),
703 .pc_ressize = sizeof(struct nfsd_diropres), 713 .pc_ressize = sizeof(struct nfsd_diropres),
704 .pc_cachetype = RC_REPLBUFF, 714 .pc_cachetype = RC_REPLBUFF,
705 .pc_xdrressize = ST+FH+AT, 715 .pc_xdrressize = ST+FH+AT,
706 }, 716 },
707 [NFSPROC_RMDIR] = { 717 [NFSPROC_RMDIR] = {
708 .pc_func = (svc_procfunc) nfsd_proc_rmdir, 718 .pc_func = nfsd_proc_rmdir,
709 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs, 719 .pc_decode = nfssvc_decode_diropargs,
710 .pc_encode = (kxdrproc_t) nfssvc_encode_void, 720 .pc_encode = nfssvc_encode_void,
711 .pc_argsize = sizeof(struct nfsd_diropargs), 721 .pc_argsize = sizeof(struct nfsd_diropargs),
712 .pc_ressize = sizeof(struct nfsd_void), 722 .pc_ressize = sizeof(struct nfsd_void),
713 .pc_cachetype = RC_REPLSTAT, 723 .pc_cachetype = RC_REPLSTAT,
714 .pc_xdrressize = ST, 724 .pc_xdrressize = ST,
715 }, 725 },
716 [NFSPROC_READDIR] = { 726 [NFSPROC_READDIR] = {
717 .pc_func = (svc_procfunc) nfsd_proc_readdir, 727 .pc_func = nfsd_proc_readdir,
718 .pc_decode = (kxdrproc_t) nfssvc_decode_readdirargs, 728 .pc_decode = nfssvc_decode_readdirargs,
719 .pc_encode = (kxdrproc_t) nfssvc_encode_readdirres, 729 .pc_encode = nfssvc_encode_readdirres,
720 .pc_argsize = sizeof(struct nfsd_readdirargs), 730 .pc_argsize = sizeof(struct nfsd_readdirargs),
721 .pc_ressize = sizeof(struct nfsd_readdirres), 731 .pc_ressize = sizeof(struct nfsd_readdirres),
722 .pc_cachetype = RC_NOCACHE, 732 .pc_cachetype = RC_NOCACHE,
723 }, 733 },
724 [NFSPROC_STATFS] = { 734 [NFSPROC_STATFS] = {
725 .pc_func = (svc_procfunc) nfsd_proc_statfs, 735 .pc_func = nfsd_proc_statfs,
726 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle, 736 .pc_decode = nfssvc_decode_fhandle,
727 .pc_encode = (kxdrproc_t) nfssvc_encode_statfsres, 737 .pc_encode = nfssvc_encode_statfsres,
728 .pc_argsize = sizeof(struct nfsd_fhandle), 738 .pc_argsize = sizeof(struct nfsd_fhandle),
729 .pc_ressize = sizeof(struct nfsd_statfsres), 739 .pc_ressize = sizeof(struct nfsd_statfsres),
730 .pc_cachetype = RC_NOCACHE, 740 .pc_cachetype = RC_NOCACHE,
@@ -733,12 +743,14 @@ static struct svc_procedure nfsd_procedures2[18] = {
733}; 743};
734 744
735 745
736struct svc_version nfsd_version2 = { 746static unsigned int nfsd_count2[ARRAY_SIZE(nfsd_procedures2)];
737 .vs_vers = 2, 747const struct svc_version nfsd_version2 = {
738 .vs_nproc = 18, 748 .vs_vers = 2,
739 .vs_proc = nfsd_procedures2, 749 .vs_nproc = 18,
740 .vs_dispatch = nfsd_dispatch, 750 .vs_proc = nfsd_procedures2,
741 .vs_xdrsize = NFS2_SVC_XDRSIZE, 751 .vs_count = nfsd_count2,
752 .vs_dispatch = nfsd_dispatch,
753 .vs_xdrsize = NFS2_SVC_XDRSIZE,
742}; 754};
743 755
744/* 756/*
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 59979f0bbd4b..063ae7de2c12 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -68,14 +68,14 @@ unsigned long nfsd_drc_mem_used;
68 68
69#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 69#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
70static struct svc_stat nfsd_acl_svcstats; 70static struct svc_stat nfsd_acl_svcstats;
71static struct svc_version * nfsd_acl_version[] = { 71static const struct svc_version *nfsd_acl_version[] = {
72 [2] = &nfsd_acl_version2, 72 [2] = &nfsd_acl_version2,
73 [3] = &nfsd_acl_version3, 73 [3] = &nfsd_acl_version3,
74}; 74};
75 75
76#define NFSD_ACL_MINVERS 2 76#define NFSD_ACL_MINVERS 2
77#define NFSD_ACL_NRVERS ARRAY_SIZE(nfsd_acl_version) 77#define NFSD_ACL_NRVERS ARRAY_SIZE(nfsd_acl_version)
78static struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS]; 78static const struct svc_version *nfsd_acl_versions[NFSD_ACL_NRVERS];
79 79
80static struct svc_program nfsd_acl_program = { 80static struct svc_program nfsd_acl_program = {
81 .pg_prog = NFS_ACL_PROGRAM, 81 .pg_prog = NFS_ACL_PROGRAM,
@@ -92,7 +92,7 @@ static struct svc_stat nfsd_acl_svcstats = {
92}; 92};
93#endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */ 93#endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */
94 94
95static struct svc_version * nfsd_version[] = { 95static const struct svc_version *nfsd_version[] = {
96 [2] = &nfsd_version2, 96 [2] = &nfsd_version2,
97#if defined(CONFIG_NFSD_V3) 97#if defined(CONFIG_NFSD_V3)
98 [3] = &nfsd_version3, 98 [3] = &nfsd_version3,
@@ -104,7 +104,7 @@ static struct svc_version * nfsd_version[] = {
104 104
105#define NFSD_MINVERS 2 105#define NFSD_MINVERS 2
106#define NFSD_NRVERS ARRAY_SIZE(nfsd_version) 106#define NFSD_NRVERS ARRAY_SIZE(nfsd_version)
107static struct svc_version *nfsd_versions[NFSD_NRVERS]; 107static const struct svc_version *nfsd_versions[NFSD_NRVERS];
108 108
109struct svc_program nfsd_program = { 109struct svc_program nfsd_program = {
110#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 110#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
@@ -756,7 +756,7 @@ static __be32 map_new_errors(u32 vers, __be32 nfserr)
756 * problem, we enforce these assumptions here: 756 * problem, we enforce these assumptions here:
757 */ 757 */
758static bool nfs_request_too_big(struct svc_rqst *rqstp, 758static bool nfs_request_too_big(struct svc_rqst *rqstp,
759 struct svc_procedure *proc) 759 const struct svc_procedure *proc)
760{ 760{
761 /* 761 /*
762 * The ACL code has more careful bounds-checking and is not 762 * The ACL code has more careful bounds-checking and is not
@@ -781,8 +781,7 @@ static bool nfs_request_too_big(struct svc_rqst *rqstp,
781int 781int
782nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) 782nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
783{ 783{
784 struct svc_procedure *proc; 784 const struct svc_procedure *proc;
785 kxdrproc_t xdr;
786 __be32 nfserr; 785 __be32 nfserr;
787 __be32 *nfserrp; 786 __be32 *nfserrp;
788 787
@@ -801,9 +800,8 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
801 */ 800 */
802 rqstp->rq_cachetype = proc->pc_cachetype; 801 rqstp->rq_cachetype = proc->pc_cachetype;
803 /* Decode arguments */ 802 /* Decode arguments */
804 xdr = proc->pc_decode; 803 if (proc->pc_decode &&
805 if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base, 804 !proc->pc_decode(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base)) {
806 rqstp->rq_argp)) {
807 dprintk("nfsd: failed to decode arguments!\n"); 805 dprintk("nfsd: failed to decode arguments!\n");
808 *statp = rpc_garbage_args; 806 *statp = rpc_garbage_args;
809 return 1; 807 return 1;
@@ -827,7 +825,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
827 rqstp->rq_res.head[0].iov_len += sizeof(__be32); 825 rqstp->rq_res.head[0].iov_len += sizeof(__be32);
828 826
829 /* Now call the procedure handler, and encode NFS status. */ 827 /* Now call the procedure handler, and encode NFS status. */
830 nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); 828 nfserr = proc->pc_func(rqstp);
831 nfserr = map_new_errors(rqstp->rq_vers, nfserr); 829 nfserr = map_new_errors(rqstp->rq_vers, nfserr);
832 if (nfserr == nfserr_dropit || test_bit(RQ_DROPME, &rqstp->rq_flags)) { 830 if (nfserr == nfserr_dropit || test_bit(RQ_DROPME, &rqstp->rq_flags)) {
833 dprintk("nfsd: Dropping request; may be revisited later\n"); 831 dprintk("nfsd: Dropping request; may be revisited later\n");
@@ -842,9 +840,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
842 * For NFSv2, additional info is never returned in case of an error. 840 * For NFSv2, additional info is never returned in case of an error.
843 */ 841 */
844 if (!(nfserr && rqstp->rq_vers == 2)) { 842 if (!(nfserr && rqstp->rq_vers == 2)) {
845 xdr = proc->pc_encode; 843 if (proc->pc_encode && !proc->pc_encode(rqstp, nfserrp)) {
846 if (xdr && !xdr(rqstp, nfserrp,
847 rqstp->rq_resp)) {
848 /* Failed to encode result. Release cache entry */ 844 /* Failed to encode result. Release cache entry */
849 dprintk("nfsd: failed to encode result!\n"); 845 dprintk("nfsd: failed to encode result!\n");
850 nfsd_cache_update(rqstp, RC_NOCACHE, NULL); 846 nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index de07ff625777..e4da2717982d 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);
@@ -276,9 +280,9 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p,
276} 280}
277 281
278int 282int
279nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, 283nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p)
280 struct nfsd_writeargs *args)
281{ 284{
285 struct nfsd_writeargs *args = rqstp->rq_argp;
282 unsigned int len, hdr, dlen; 286 unsigned int len, hdr, dlen;
283 struct kvec *head = rqstp->rq_arg.head; 287 struct kvec *head = rqstp->rq_arg.head;
284 int v; 288 int v;
@@ -332,9 +336,10 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
332} 336}
333 337
334int 338int
335nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p, 339nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p)
336 struct nfsd_createargs *args)
337{ 340{
341 struct nfsd_createargs *args = rqstp->rq_argp;
342
338 if ( !(p = decode_fh(p, &args->fh)) 343 if ( !(p = decode_fh(p, &args->fh))
339 || !(p = decode_filename(p, &args->name, &args->len))) 344 || !(p = decode_filename(p, &args->name, &args->len)))
340 return 0; 345 return 0;
@@ -344,9 +349,10 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p,
344} 349}
345 350
346int 351int
347nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p, 352nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p)
348 struct nfsd_renameargs *args)
349{ 353{
354 struct nfsd_renameargs *args = rqstp->rq_argp;
355
350 if (!(p = decode_fh(p, &args->ffh)) 356 if (!(p = decode_fh(p, &args->ffh))
351 || !(p = decode_filename(p, &args->fname, &args->flen)) 357 || !(p = decode_filename(p, &args->fname, &args->flen))
352 || !(p = decode_fh(p, &args->tfh)) 358 || !(p = decode_fh(p, &args->tfh))
@@ -357,8 +363,10 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p,
357} 363}
358 364
359int 365int
360nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readlinkargs *args) 366nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p)
361{ 367{
368 struct nfsd_readlinkargs *args = rqstp->rq_argp;
369
362 p = decode_fh(p, &args->fh); 370 p = decode_fh(p, &args->fh);
363 if (!p) 371 if (!p)
364 return 0; 372 return 0;
@@ -368,9 +376,10 @@ nfssvc_decode_readlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readli
368} 376}
369 377
370int 378int
371nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p, 379nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p)
372 struct nfsd_linkargs *args)
373{ 380{
381 struct nfsd_linkargs *args = rqstp->rq_argp;
382
374 if (!(p = decode_fh(p, &args->ffh)) 383 if (!(p = decode_fh(p, &args->ffh))
375 || !(p = decode_fh(p, &args->tfh)) 384 || !(p = decode_fh(p, &args->tfh))
376 || !(p = decode_filename(p, &args->tname, &args->tlen))) 385 || !(p = decode_filename(p, &args->tname, &args->tlen)))
@@ -380,9 +389,10 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p,
380} 389}
381 390
382int 391int
383nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, 392nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p)
384 struct nfsd_symlinkargs *args)
385{ 393{
394 struct nfsd_symlinkargs *args = rqstp->rq_argp;
395
386 if ( !(p = decode_fh(p, &args->ffh)) 396 if ( !(p = decode_fh(p, &args->ffh))
387 || !(p = decode_filename(p, &args->fname, &args->flen)) 397 || !(p = decode_filename(p, &args->fname, &args->flen))
388 || !(p = decode_pathname(p, &args->tname, &args->tlen))) 398 || !(p = decode_pathname(p, &args->tname, &args->tlen)))
@@ -393,9 +403,10 @@ nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p,
393} 403}
394 404
395int 405int
396nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, 406nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
397 struct nfsd_readdirargs *args)
398{ 407{
408 struct nfsd_readdirargs *args = rqstp->rq_argp;
409
399 p = decode_fh(p, &args->fh); 410 p = decode_fh(p, &args->fh);
400 if (!p) 411 if (!p)
401 return 0; 412 return 0;
@@ -411,32 +422,35 @@ nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p,
411 * XDR encode functions 422 * XDR encode functions
412 */ 423 */
413int 424int
414nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 425nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
415{ 426{
416 return xdr_ressize_check(rqstp, p); 427 return xdr_ressize_check(rqstp, p);
417} 428}
418 429
419int 430int
420nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, 431nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p)
421 struct nfsd_attrstat *resp)
422{ 432{
433 struct nfsd_attrstat *resp = rqstp->rq_resp;
434
423 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 435 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
424 return xdr_ressize_check(rqstp, p); 436 return xdr_ressize_check(rqstp, p);
425} 437}
426 438
427int 439int
428nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, 440nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p)
429 struct nfsd_diropres *resp)
430{ 441{
442 struct nfsd_diropres *resp = rqstp->rq_resp;
443
431 p = encode_fh(p, &resp->fh); 444 p = encode_fh(p, &resp->fh);
432 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 445 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
433 return xdr_ressize_check(rqstp, p); 446 return xdr_ressize_check(rqstp, p);
434} 447}
435 448
436int 449int
437nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, 450nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
438 struct nfsd_readlinkres *resp)
439{ 451{
452 struct nfsd_readlinkres *resp = rqstp->rq_resp;
453
440 *p++ = htonl(resp->len); 454 *p++ = htonl(resp->len);
441 xdr_ressize_check(rqstp, p); 455 xdr_ressize_check(rqstp, p);
442 rqstp->rq_res.page_len = resp->len; 456 rqstp->rq_res.page_len = resp->len;
@@ -450,9 +464,10 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p,
450} 464}
451 465
452int 466int
453nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, 467nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
454 struct nfsd_readres *resp)
455{ 468{
469 struct nfsd_readres *resp = rqstp->rq_resp;
470
456 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 471 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat);
457 *p++ = htonl(resp->count); 472 *p++ = htonl(resp->count);
458 xdr_ressize_check(rqstp, p); 473 xdr_ressize_check(rqstp, p);
@@ -469,9 +484,10 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p,
469} 484}
470 485
471int 486int
472nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, 487nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p)
473 struct nfsd_readdirres *resp)
474{ 488{
489 struct nfsd_readdirres *resp = rqstp->rq_resp;
490
475 xdr_ressize_check(rqstp, p); 491 xdr_ressize_check(rqstp, p);
476 p = resp->buffer; 492 p = resp->buffer;
477 *p++ = 0; /* no more entries */ 493 *p++ = 0; /* no more entries */
@@ -482,9 +498,9 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p,
482} 498}
483 499
484int 500int
485nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p, 501nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p)
486 struct nfsd_statfsres *resp)
487{ 502{
503 struct nfsd_statfsres *resp = rqstp->rq_resp;
488 struct kstatfs *stat = &resp->stats; 504 struct kstatfs *stat = &resp->stats;
489 505
490 *p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */ 506 *p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */
@@ -543,10 +559,10 @@ nfssvc_encode_entry(void *ccdv, const char *name,
543/* 559/*
544 * XDR release functions 560 * XDR release functions
545 */ 561 */
546int 562void
547nfssvc_release_fhandle(struct svc_rqst *rqstp, __be32 *p, 563nfssvc_release_fhandle(struct svc_rqst *rqstp)
548 struct nfsd_fhandle *resp)
549{ 564{
565 struct nfsd_fhandle *resp = rqstp->rq_resp;
566
550 fh_put(&resp->fh); 567 fh_put(&resp->fh);
551 return 1;
552} 568}
diff --git a/fs/nfsd/xdr.h b/fs/nfsd/xdr.h
index 4f0481d63804..457ce45e5084 100644
--- a/fs/nfsd/xdr.h
+++ b/fs/nfsd/xdr.h
@@ -131,40 +131,30 @@ 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 *, 146int nfssvc_encode_void(struct svc_rqst *, __be32 *);
147 struct nfsd_renameargs *); 147int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *);
148int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *, 148int nfssvc_encode_diropres(struct svc_rqst *, __be32 *);
149 struct nfsd_readlinkargs *); 149int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *);
150int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *, 150int nfssvc_encode_readres(struct svc_rqst *, __be32 *);
151 struct nfsd_linkargs *); 151int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *);
152int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *, 152int nfssvc_encode_readdirres(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 *);
157int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *);
158int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *);
159int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *);
160int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *);
161int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *);
162int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *);
163 153
164int nfssvc_encode_entry(void *, const char *name, 154int nfssvc_encode_entry(void *, const char *name,
165 int namlen, loff_t offset, u64 ino, unsigned int); 155 int namlen, loff_t offset, u64 ino, unsigned int);
166 156
167int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); 157void nfssvc_release_fhandle(struct svc_rqst *);
168 158
169/* Helper functions for NFSv2 ACL code */ 159/* Helper functions for NFSv2 ACL code */
170__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, struct kstat *stat); 160__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, struct kstat *stat);
diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h
index 335e04aaf7db..80d7da620e91 100644
--- a/fs/nfsd/xdr3.h
+++ b/fs/nfsd/xdr3.h
@@ -269,71 +269,41 @@ 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 *); 288int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *);
289int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *, 289int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *);
290 struct nfsd3_renameargs *); 290int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *);
291int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *, 291int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *);
292 struct nfsd3_readlinkargs *); 292int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *);
293int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *, 293int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *);
294 struct nfsd3_linkargs *); 294int nfs3svc_encode_readres(struct svc_rqst *, __be32 *);
295int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *, 295int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *);
296 struct nfsd3_symlinkargs *); 296int nfs3svc_encode_createres(struct svc_rqst *, __be32 *);
297int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *, 297int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *);
298 struct nfsd3_readdirargs *); 298int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *);
299int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *, 299int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *);
300 struct nfsd3_readdirargs *); 300int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *);
301int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *, 301int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *);
302 struct nfsd3_commitargs *); 302int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *);
303int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 303int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *);
304int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, 304
305 struct nfsd3_attrstat *); 305void nfs3svc_release_fhandle(struct svc_rqst *);
306int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, 306void nfs3svc_release_fhandle2(struct svc_rqst *);
307 struct nfsd3_attrstat *);
308int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *,
309 struct nfsd3_diropres *);
310int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *,
311 struct nfsd3_accessres *);
312int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *,
313 struct nfsd3_readlinkres *);
314int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *);
315int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *);
316int nfs3svc_encode_createres(struct svc_rqst *, __be32 *,
317 struct nfsd3_diropres *);
318int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *,
319 struct nfsd3_renameres *);
320int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *,
321 struct nfsd3_linkres *);
322int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *,
323 struct nfsd3_readdirres *);
324int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *,
325 struct nfsd3_fsstatres *);
326int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *,
327 struct nfsd3_fsinfores *);
328int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *,
329 struct nfsd3_pathconfres *);
330int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *,
331 struct nfsd3_commitres *);
332
333int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *,
334 struct nfsd3_attrstat *);
335int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *,
336 struct nfsd3_fhandle_pair *);
337int nfs3svc_encode_entry(void *, const char *name, 307int nfs3svc_encode_entry(void *, const char *name,
338 int namlen, loff_t offset, u64 ino, 308 int namlen, loff_t offset, u64 ino,
339 unsigned int); 309 unsigned int);
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 8fda4abdf3b1..72c6ad136107 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -539,7 +539,7 @@ struct nfsd4_seek {
539struct nfsd4_op { 539struct nfsd4_op {
540 int opnum; 540 int opnum;
541 __be32 status; 541 __be32 status;
542 union { 542 union nfsd4_op_u {
543 struct nfsd4_access access; 543 struct nfsd4_access access;
544 struct nfsd4_close close; 544 struct nfsd4_close close;
545 struct nfsd4_commit commit; 545 struct nfsd4_commit commit;
@@ -577,6 +577,7 @@ struct nfsd4_op {
577 struct nfsd4_bind_conn_to_session bind_conn_to_session; 577 struct nfsd4_bind_conn_to_session bind_conn_to_session;
578 struct nfsd4_create_session create_session; 578 struct nfsd4_create_session create_session;
579 struct nfsd4_destroy_session destroy_session; 579 struct nfsd4_destroy_session destroy_session;
580 struct nfsd4_destroy_clientid destroy_clientid;
580 struct nfsd4_sequence sequence; 581 struct nfsd4_sequence sequence;
581 struct nfsd4_reclaim_complete reclaim_complete; 582 struct nfsd4_reclaim_complete reclaim_complete;
582 struct nfsd4_test_stateid test_stateid; 583 struct nfsd4_test_stateid test_stateid;
@@ -585,6 +586,7 @@ struct nfsd4_op {
585 struct nfsd4_layoutget layoutget; 586 struct nfsd4_layoutget layoutget;
586 struct nfsd4_layoutcommit layoutcommit; 587 struct nfsd4_layoutcommit layoutcommit;
587 struct nfsd4_layoutreturn layoutreturn; 588 struct nfsd4_layoutreturn layoutreturn;
589 struct nfsd4_secinfo_no_name secinfo_no_name;
588 590
589 /* NFSv4.2 */ 591 /* NFSv4.2 */
590 struct nfsd4_fallocate allocate; 592 struct nfsd4_fallocate allocate;
@@ -682,11 +684,9 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
682 684
683 685
684bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); 686bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
685int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 687int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *);
686int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, 688int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *);
687 struct nfsd4_compoundargs *); 689int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *);
688int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
689 struct nfsd4_compoundres *);
690__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); 690__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
691void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); 691void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
692void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op); 692void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op);
@@ -695,27 +695,26 @@ __be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words,
695 struct dentry *dentry, 695 struct dentry *dentry,
696 u32 *bmval, struct svc_rqst *, int ignore_crossmnt); 696 u32 *bmval, struct svc_rqst *, int ignore_crossmnt);
697extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, 697extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
698 struct nfsd4_compound_state *, 698 struct nfsd4_compound_state *, union nfsd4_op_u *u);
699 struct nfsd4_setclientid *setclid);
700extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 699extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
701 struct nfsd4_compound_state *, 700 struct nfsd4_compound_state *, union nfsd4_op_u *u);
702 struct nfsd4_setclientid_confirm *setclientid_confirm);
703extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp, 701extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp,
704 struct nfsd4_compound_state *, struct nfsd4_exchange_id *); 702 struct nfsd4_compound_state *, union nfsd4_op_u *u);
705extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_backchannel_ctl *); 703extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *,
706extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_bind_conn_to_session *); 704 struct nfsd4_compound_state *, union nfsd4_op_u *u);
705extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *,
706 struct nfsd4_compound_state *, union nfsd4_op_u *u);
707extern __be32 nfsd4_create_session(struct svc_rqst *, 707extern __be32 nfsd4_create_session(struct svc_rqst *,
708 struct nfsd4_compound_state *, 708 struct nfsd4_compound_state *, union nfsd4_op_u *u);
709 struct nfsd4_create_session *);
710extern __be32 nfsd4_sequence(struct svc_rqst *, 709extern __be32 nfsd4_sequence(struct svc_rqst *,
711 struct nfsd4_compound_state *, 710 struct nfsd4_compound_state *, union nfsd4_op_u *u);
712 struct nfsd4_sequence *);
713extern void nfsd4_sequence_done(struct nfsd4_compoundres *resp); 711extern void nfsd4_sequence_done(struct nfsd4_compoundres *resp);
714extern __be32 nfsd4_destroy_session(struct svc_rqst *, 712extern __be32 nfsd4_destroy_session(struct svc_rqst *,
715 struct nfsd4_compound_state *, 713 struct nfsd4_compound_state *, union nfsd4_op_u *u);
716 struct nfsd4_destroy_session *); 714extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *,
717extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_clientid *); 715 union nfsd4_op_u *u);
718__be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_reclaim_complete *); 716__be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *,
717 union nfsd4_op_u *u);
719extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, 718extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *,
720 struct nfsd4_open *open, struct nfsd_net *nn); 719 struct nfsd4_open *open, struct nfsd_net *nn);
721extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, 720extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
@@ -724,34 +723,29 @@ extern void nfsd4_cstate_clear_replay(struct nfsd4_compound_state *cstate);
724extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, 723extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate,
725 struct nfsd4_open *open); 724 struct nfsd4_open *open);
726extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 725extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
727 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); 726 struct nfsd4_compound_state *, union nfsd4_op_u *u);
728extern __be32 nfsd4_close(struct svc_rqst *rqstp, 727extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
729 struct nfsd4_compound_state *, 728 union nfsd4_op_u *u);
730 struct nfsd4_close *close);
731extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, 729extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
732 struct nfsd4_compound_state *, 730 struct nfsd4_compound_state *, union nfsd4_op_u *u);
733 struct nfsd4_open_downgrade *od);
734extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 731extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
735 struct nfsd4_lock *lock); 732 union nfsd4_op_u *u);
736extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, 733extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
737 struct nfsd4_compound_state *, 734 union nfsd4_op_u *u);
738 struct nfsd4_lockt *lockt); 735extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
739extern __be32 nfsd4_locku(struct svc_rqst *rqstp, 736 union nfsd4_op_u *u);
740 struct nfsd4_compound_state *,
741 struct nfsd4_locku *locku);
742extern __be32 737extern __be32
743nfsd4_release_lockowner(struct svc_rqst *rqstp, 738nfsd4_release_lockowner(struct svc_rqst *rqstp,
744 struct nfsd4_compound_state *, 739 struct nfsd4_compound_state *, union nfsd4_op_u *u);
745 struct nfsd4_release_lockowner *rlockowner); 740extern void nfsd4_release_compoundargs(struct svc_rqst *rqstp);
746extern int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp);
747extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, 741extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
748 struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); 742 struct nfsd4_compound_state *, union nfsd4_op_u *u);
749extern __be32 nfsd4_renew(struct svc_rqst *rqstp, 743extern __be32 nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
750 struct nfsd4_compound_state *, clientid_t *clid); 744 union nfsd4_op_u *u);
751extern __be32 nfsd4_test_stateid(struct svc_rqst *rqstp, 745extern __be32 nfsd4_test_stateid(struct svc_rqst *rqstp,
752 struct nfsd4_compound_state *, struct nfsd4_test_stateid *test_stateid); 746 struct nfsd4_compound_state *, union nfsd4_op_u *);
753extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp, 747extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp,
754 struct nfsd4_compound_state *, struct nfsd4_free_stateid *free_stateid); 748 struct nfsd4_compound_state *, union nfsd4_op_u *);
755extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr); 749extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr);
756 750
757#endif 751#endif