2 * Process version 3 NFS requests.
4 * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir@monad.swb.de>
8 #include <linux/ext2_fs.h>
9 #include <linux/magic.h>
15 #define NFSDDBG_FACILITY NFSDDBG_PROC
17 #define RETURN_STATUS(st) { resp->status = (st); return (st); }
19 static int nfs3_ftypes
[] = {
26 S_IFSOCK
, /* NF3SOCK */
27 S_IFIFO
, /* NF3FIFO */
34 nfsd3_proc_null(struct svc_rqst
*rqstp
, void *argp
, void *resp
)
40 * Get a file's attributes
43 nfsd3_proc_getattr(struct svc_rqst
*rqstp
, struct nfsd_fhandle
*argp
,
44 struct nfsd3_attrstat
*resp
)
48 dprintk("nfsd: GETATTR(3) %s\n",
49 SVCFH_fmt(&argp
->fh
));
51 fh_copy(&resp
->fh
, &argp
->fh
);
52 nfserr
= fh_verify(rqstp
, &resp
->fh
, 0,
53 NFSD_MAY_NOP
| NFSD_MAY_BYPASS_GSS_ON_ROOT
);
55 RETURN_STATUS(nfserr
);
57 nfserr
= fh_getattr(&resp
->fh
, &resp
->stat
);
59 RETURN_STATUS(nfserr
);
63 * Set a file's attributes
66 nfsd3_proc_setattr(struct svc_rqst
*rqstp
, struct nfsd3_sattrargs
*argp
,
67 struct nfsd3_attrstat
*resp
)
71 dprintk("nfsd: SETATTR(3) %s\n",
72 SVCFH_fmt(&argp
->fh
));
74 fh_copy(&resp
->fh
, &argp
->fh
);
75 nfserr
= nfsd_setattr(rqstp
, &resp
->fh
, &argp
->attrs
,
76 argp
->check_guard
, argp
->guardtime
);
77 RETURN_STATUS(nfserr
);
81 * Look up a path name component
84 nfsd3_proc_lookup(struct svc_rqst
*rqstp
, struct nfsd3_diropargs
*argp
,
85 struct nfsd3_diropres
*resp
)
89 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
94 fh_copy(&resp
->dirfh
, &argp
->fh
);
95 fh_init(&resp
->fh
, NFS3_FHSIZE
);
97 nfserr
= nfsd_lookup(rqstp
, &resp
->dirfh
,
101 RETURN_STATUS(nfserr
);
108 nfsd3_proc_access(struct svc_rqst
*rqstp
, struct nfsd3_accessargs
*argp
,
109 struct nfsd3_accessres
*resp
)
113 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
114 SVCFH_fmt(&argp
->fh
),
117 fh_copy(&resp
->fh
, &argp
->fh
);
118 resp
->access
= argp
->access
;
119 nfserr
= nfsd_access(rqstp
, &resp
->fh
, &resp
->access
, NULL
);
120 RETURN_STATUS(nfserr
);
127 nfsd3_proc_readlink(struct svc_rqst
*rqstp
, struct nfsd3_readlinkargs
*argp
,
128 struct nfsd3_readlinkres
*resp
)
132 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp
->fh
));
134 /* Read the symlink. */
135 fh_copy(&resp
->fh
, &argp
->fh
);
136 resp
->len
= NFS3_MAXPATHLEN
;
137 nfserr
= nfsd_readlink(rqstp
, &resp
->fh
, argp
->buffer
, &resp
->len
);
138 RETURN_STATUS(nfserr
);
142 * Read a portion of a file.
145 nfsd3_proc_read(struct svc_rqst
*rqstp
, struct nfsd3_readargs
*argp
,
146 struct nfsd3_readres
*resp
)
149 u32 max_blocksize
= svc_max_payload(rqstp
);
150 unsigned long cnt
= min(argp
->count
, max_blocksize
);
152 dprintk("nfsd: READ(3) %s %lu bytes at %Lu\n",
153 SVCFH_fmt(&argp
->fh
),
154 (unsigned long) argp
->count
,
155 (unsigned long long) argp
->offset
);
157 /* Obtain buffer pointer for payload.
158 * 1 (status) + 22 (post_op_attr) + 1 (count) + 1 (eof)
159 * + 1 (xdr opaque byte count) = 26
162 svc_reserve_auth(rqstp
, ((1 + NFS3_POST_OP_ATTR_WORDS
+ 3)<<2) + resp
->count
+4);
164 fh_copy(&resp
->fh
, &argp
->fh
);
165 nfserr
= nfsd_read(rqstp
, &resp
->fh
,
167 rqstp
->rq_vec
, argp
->vlen
,
170 struct inode
*inode
= d_inode(resp
->fh
.fh_dentry
);
171 resp
->eof
= nfsd_eof_on_read(cnt
, resp
->count
, argp
->offset
,
175 RETURN_STATUS(nfserr
);
179 * Write data to a file
182 nfsd3_proc_write(struct svc_rqst
*rqstp
, struct nfsd3_writeargs
*argp
,
183 struct nfsd3_writeres
*resp
)
186 unsigned long cnt
= argp
->len
;
188 dprintk("nfsd: WRITE(3) %s %d bytes at %Lu%s\n",
189 SVCFH_fmt(&argp
->fh
),
191 (unsigned long long) argp
->offset
,
192 argp
->stable
? " stable" : "");
194 fh_copy(&resp
->fh
, &argp
->fh
);
195 resp
->committed
= argp
->stable
;
196 nfserr
= nfsd_write(rqstp
, &resp
->fh
, argp
->offset
,
197 rqstp
->rq_vec
, argp
->vlen
,
198 &cnt
, resp
->committed
);
200 RETURN_STATUS(nfserr
);
204 * With NFSv3, CREATE processing is a lot easier than with NFSv2.
205 * At least in theory; we'll see how it fares in practice when the
206 * first reports about SunOS compatibility problems start to pour in...
209 nfsd3_proc_create(struct svc_rqst
*rqstp
, struct nfsd3_createargs
*argp
,
210 struct nfsd3_diropres
*resp
)
212 svc_fh
*dirfhp
, *newfhp
= NULL
;
216 dprintk("nfsd: CREATE(3) %s %.*s\n",
217 SVCFH_fmt(&argp
->fh
),
221 dirfhp
= fh_copy(&resp
->dirfh
, &argp
->fh
);
222 newfhp
= fh_init(&resp
->fh
, NFS3_FHSIZE
);
225 /* Unfudge the mode bits */
226 attr
->ia_mode
&= ~S_IFMT
;
227 if (!(attr
->ia_valid
& ATTR_MODE
)) {
228 attr
->ia_valid
|= ATTR_MODE
;
229 attr
->ia_mode
= S_IFREG
;
231 attr
->ia_mode
= (attr
->ia_mode
& ~S_IFMT
) | S_IFREG
;
234 /* Now create the file and set attributes */
235 nfserr
= do_nfsd_create(rqstp
, dirfhp
, argp
->name
, argp
->len
,
237 argp
->createmode
, (u32
*)argp
->verf
, NULL
, NULL
);
239 RETURN_STATUS(nfserr
);
243 * Make directory. This operation is not idempotent.
246 nfsd3_proc_mkdir(struct svc_rqst
*rqstp
, struct nfsd3_createargs
*argp
,
247 struct nfsd3_diropres
*resp
)
251 dprintk("nfsd: MKDIR(3) %s %.*s\n",
252 SVCFH_fmt(&argp
->fh
),
256 argp
->attrs
.ia_valid
&= ~ATTR_SIZE
;
257 fh_copy(&resp
->dirfh
, &argp
->fh
);
258 fh_init(&resp
->fh
, NFS3_FHSIZE
);
259 nfserr
= nfsd_create(rqstp
, &resp
->dirfh
, argp
->name
, argp
->len
,
260 &argp
->attrs
, S_IFDIR
, 0, &resp
->fh
);
261 fh_unlock(&resp
->dirfh
);
262 RETURN_STATUS(nfserr
);
266 nfsd3_proc_symlink(struct svc_rqst
*rqstp
, struct nfsd3_symlinkargs
*argp
,
267 struct nfsd3_diropres
*resp
)
271 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
272 SVCFH_fmt(&argp
->ffh
),
273 argp
->flen
, argp
->fname
,
274 argp
->tlen
, argp
->tname
);
276 fh_copy(&resp
->dirfh
, &argp
->ffh
);
277 fh_init(&resp
->fh
, NFS3_FHSIZE
);
278 nfserr
= nfsd_symlink(rqstp
, &resp
->dirfh
, argp
->fname
, argp
->flen
,
279 argp
->tname
, &resp
->fh
);
280 RETURN_STATUS(nfserr
);
284 * Make socket/fifo/device.
287 nfsd3_proc_mknod(struct svc_rqst
*rqstp
, struct nfsd3_mknodargs
*argp
,
288 struct nfsd3_diropres
*resp
)
294 dprintk("nfsd: MKNOD(3) %s %.*s\n",
295 SVCFH_fmt(&argp
->fh
),
299 fh_copy(&resp
->dirfh
, &argp
->fh
);
300 fh_init(&resp
->fh
, NFS3_FHSIZE
);
302 if (argp
->ftype
== 0 || argp
->ftype
>= NF3BAD
)
303 RETURN_STATUS(nfserr_inval
);
304 if (argp
->ftype
== NF3CHR
|| argp
->ftype
== NF3BLK
) {
305 rdev
= MKDEV(argp
->major
, argp
->minor
);
306 if (MAJOR(rdev
) != argp
->major
||
307 MINOR(rdev
) != argp
->minor
)
308 RETURN_STATUS(nfserr_inval
);
310 if (argp
->ftype
!= NF3SOCK
&& argp
->ftype
!= NF3FIFO
)
311 RETURN_STATUS(nfserr_inval
);
313 type
= nfs3_ftypes
[argp
->ftype
];
314 nfserr
= nfsd_create(rqstp
, &resp
->dirfh
, argp
->name
, argp
->len
,
315 &argp
->attrs
, type
, rdev
, &resp
->fh
);
316 fh_unlock(&resp
->dirfh
);
317 RETURN_STATUS(nfserr
);
321 * Remove file/fifo/socket etc.
324 nfsd3_proc_remove(struct svc_rqst
*rqstp
, struct nfsd3_diropargs
*argp
,
325 struct nfsd3_attrstat
*resp
)
329 dprintk("nfsd: REMOVE(3) %s %.*s\n",
330 SVCFH_fmt(&argp
->fh
),
334 /* Unlink. -S_IFDIR means file must not be a directory */
335 fh_copy(&resp
->fh
, &argp
->fh
);
336 nfserr
= nfsd_unlink(rqstp
, &resp
->fh
, -S_IFDIR
, argp
->name
, argp
->len
);
337 fh_unlock(&resp
->fh
);
338 RETURN_STATUS(nfserr
);
345 nfsd3_proc_rmdir(struct svc_rqst
*rqstp
, struct nfsd3_diropargs
*argp
,
346 struct nfsd3_attrstat
*resp
)
350 dprintk("nfsd: RMDIR(3) %s %.*s\n",
351 SVCFH_fmt(&argp
->fh
),
355 fh_copy(&resp
->fh
, &argp
->fh
);
356 nfserr
= nfsd_unlink(rqstp
, &resp
->fh
, S_IFDIR
, argp
->name
, argp
->len
);
357 fh_unlock(&resp
->fh
);
358 RETURN_STATUS(nfserr
);
362 nfsd3_proc_rename(struct svc_rqst
*rqstp
, struct nfsd3_renameargs
*argp
,
363 struct nfsd3_renameres
*resp
)
367 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
368 SVCFH_fmt(&argp
->ffh
),
371 dprintk("nfsd: -> %s %.*s\n",
372 SVCFH_fmt(&argp
->tfh
),
376 fh_copy(&resp
->ffh
, &argp
->ffh
);
377 fh_copy(&resp
->tfh
, &argp
->tfh
);
378 nfserr
= nfsd_rename(rqstp
, &resp
->ffh
, argp
->fname
, argp
->flen
,
379 &resp
->tfh
, argp
->tname
, argp
->tlen
);
380 RETURN_STATUS(nfserr
);
384 nfsd3_proc_link(struct svc_rqst
*rqstp
, struct nfsd3_linkargs
*argp
,
385 struct nfsd3_linkres
*resp
)
389 dprintk("nfsd: LINK(3) %s ->\n",
390 SVCFH_fmt(&argp
->ffh
));
391 dprintk("nfsd: -> %s %.*s\n",
392 SVCFH_fmt(&argp
->tfh
),
396 fh_copy(&resp
->fh
, &argp
->ffh
);
397 fh_copy(&resp
->tfh
, &argp
->tfh
);
398 nfserr
= nfsd_link(rqstp
, &resp
->tfh
, argp
->tname
, argp
->tlen
,
400 RETURN_STATUS(nfserr
);
404 * Read a portion of a directory.
407 nfsd3_proc_readdir(struct svc_rqst
*rqstp
, struct nfsd3_readdirargs
*argp
,
408 struct nfsd3_readdirres
*resp
)
413 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
414 SVCFH_fmt(&argp
->fh
),
415 argp
->count
, (u32
) argp
->cookie
);
417 /* Make sure we've room for the NULL ptr & eof flag, and shrink to
418 * client read size */
419 count
= (argp
->count
>> 2) - 2;
421 /* Read directory and encode entries on the fly */
422 fh_copy(&resp
->fh
, &argp
->fh
);
424 resp
->buflen
= count
;
425 resp
->common
.err
= nfs_ok
;
426 resp
->buffer
= argp
->buffer
;
428 nfserr
= nfsd_readdir(rqstp
, &resp
->fh
, (loff_t
*) &argp
->cookie
,
429 &resp
->common
, nfs3svc_encode_entry
);
430 memcpy(resp
->verf
, argp
->verf
, 8);
431 resp
->count
= resp
->buffer
- argp
->buffer
;
433 xdr_encode_hyper(resp
->offset
, argp
->cookie
);
435 RETURN_STATUS(nfserr
);
439 * Read a portion of a directory, including file handles and attrs.
440 * For now, we choose to ignore the dircount parameter.
443 nfsd3_proc_readdirplus(struct svc_rqst
*rqstp
, struct nfsd3_readdirargs
*argp
,
444 struct nfsd3_readdirres
*resp
)
450 caddr_t page_addr
= NULL
;
452 dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
453 SVCFH_fmt(&argp
->fh
),
454 argp
->count
, (u32
) argp
->cookie
);
456 /* Convert byte count to number of words (i.e. >> 2),
457 * and reserve room for the NULL ptr & eof flag (-2 words) */
458 resp
->count
= (argp
->count
>> 2) - 2;
460 /* Read directory and encode entries on the fly */
461 fh_copy(&resp
->fh
, &argp
->fh
);
463 resp
->common
.err
= nfs_ok
;
464 resp
->buffer
= argp
->buffer
;
465 resp
->buflen
= resp
->count
;
467 offset
= argp
->cookie
;
469 nfserr
= fh_verify(rqstp
, &resp
->fh
, S_IFDIR
, NFSD_MAY_NOP
);
471 RETURN_STATUS(nfserr
);
473 if (resp
->fh
.fh_export
->ex_flags
& NFSEXP_NOREADDIRPLUS
)
474 RETURN_STATUS(nfserr_notsupp
);
476 nfserr
= nfsd_readdir(rqstp
, &resp
->fh
,
479 nfs3svc_encode_entry_plus
);
480 memcpy(resp
->verf
, argp
->verf
, 8);
481 for (p
= rqstp
->rq_respages
+ 1; p
< rqstp
->rq_next_page
; p
++) {
482 page_addr
= page_address(*p
);
484 if (((caddr_t
)resp
->buffer
>= page_addr
) &&
485 ((caddr_t
)resp
->buffer
< page_addr
+ PAGE_SIZE
)) {
486 count
+= (caddr_t
)resp
->buffer
- page_addr
;
491 resp
->count
= count
>> 2;
493 if (unlikely(resp
->offset1
)) {
494 /* we ended up with offset on a page boundary */
495 *resp
->offset
= htonl(offset
>> 32);
496 *resp
->offset1
= htonl(offset
& 0xffffffff);
497 resp
->offset1
= NULL
;
499 xdr_encode_hyper(resp
->offset
, offset
);
503 RETURN_STATUS(nfserr
);
507 * Get file system stats
510 nfsd3_proc_fsstat(struct svc_rqst
* rqstp
, struct nfsd_fhandle
*argp
,
511 struct nfsd3_fsstatres
*resp
)
515 dprintk("nfsd: FSSTAT(3) %s\n",
516 SVCFH_fmt(&argp
->fh
));
518 nfserr
= nfsd_statfs(rqstp
, &argp
->fh
, &resp
->stats
, 0);
520 RETURN_STATUS(nfserr
);
524 * Get file system info
527 nfsd3_proc_fsinfo(struct svc_rqst
* rqstp
, struct nfsd_fhandle
*argp
,
528 struct nfsd3_fsinfores
*resp
)
531 u32 max_blocksize
= svc_max_payload(rqstp
);
533 dprintk("nfsd: FSINFO(3) %s\n",
534 SVCFH_fmt(&argp
->fh
));
536 resp
->f_rtmax
= max_blocksize
;
537 resp
->f_rtpref
= max_blocksize
;
538 resp
->f_rtmult
= PAGE_SIZE
;
539 resp
->f_wtmax
= max_blocksize
;
540 resp
->f_wtpref
= max_blocksize
;
541 resp
->f_wtmult
= PAGE_SIZE
;
542 resp
->f_dtpref
= PAGE_SIZE
;
543 resp
->f_maxfilesize
= ~(u32
) 0;
544 resp
->f_properties
= NFS3_FSF_DEFAULT
;
546 nfserr
= fh_verify(rqstp
, &argp
->fh
, 0,
547 NFSD_MAY_NOP
| NFSD_MAY_BYPASS_GSS_ON_ROOT
);
549 /* Check special features of the file system. May request
550 * different read/write sizes for file systems known to have
551 * problems with large blocks */
553 struct super_block
*sb
= argp
->fh
.fh_dentry
->d_sb
;
555 /* Note that we don't care for remote fs's here */
556 if (sb
->s_magic
== MSDOS_SUPER_MAGIC
) {
557 resp
->f_properties
= NFS3_FSF_BILLYBOY
;
559 resp
->f_maxfilesize
= sb
->s_maxbytes
;
563 RETURN_STATUS(nfserr
);
567 * Get pathconf info for the specified file
570 nfsd3_proc_pathconf(struct svc_rqst
* rqstp
, struct nfsd_fhandle
*argp
,
571 struct nfsd3_pathconfres
*resp
)
575 dprintk("nfsd: PATHCONF(3) %s\n",
576 SVCFH_fmt(&argp
->fh
));
578 /* Set default pathconf */
579 resp
->p_link_max
= 255; /* at least */
580 resp
->p_name_max
= 255; /* at least */
581 resp
->p_no_trunc
= 0;
582 resp
->p_chown_restricted
= 1;
583 resp
->p_case_insensitive
= 0;
584 resp
->p_case_preserving
= 1;
586 nfserr
= fh_verify(rqstp
, &argp
->fh
, 0, NFSD_MAY_NOP
);
589 struct super_block
*sb
= argp
->fh
.fh_dentry
->d_sb
;
591 /* Note that we don't care for remote fs's here */
592 switch (sb
->s_magic
) {
593 case EXT2_SUPER_MAGIC
:
594 resp
->p_link_max
= EXT2_LINK_MAX
;
595 resp
->p_name_max
= EXT2_NAME_LEN
;
597 case MSDOS_SUPER_MAGIC
:
598 resp
->p_case_insensitive
= 1;
599 resp
->p_case_preserving
= 0;
605 RETURN_STATUS(nfserr
);
610 * Commit a file (range) to stable storage.
613 nfsd3_proc_commit(struct svc_rqst
* rqstp
, struct nfsd3_commitargs
*argp
,
614 struct nfsd3_commitres
*resp
)
618 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
619 SVCFH_fmt(&argp
->fh
),
621 (unsigned long long) argp
->offset
);
623 if (argp
->offset
> NFS_OFFSET_MAX
)
624 RETURN_STATUS(nfserr_inval
);
626 fh_copy(&resp
->fh
, &argp
->fh
);
627 nfserr
= nfsd_commit(rqstp
, &resp
->fh
, argp
->offset
, argp
->count
);
629 RETURN_STATUS(nfserr
);
634 * NFSv3 Server procedures.
635 * Only the results of non-idempotent operations are cached.
637 #define nfs3svc_decode_fhandleargs nfs3svc_decode_fhandle
638 #define nfs3svc_encode_attrstatres nfs3svc_encode_attrstat
639 #define nfs3svc_encode_wccstatres nfs3svc_encode_wccstat
640 #define nfsd3_mkdirargs nfsd3_createargs
641 #define nfsd3_readdirplusargs nfsd3_readdirargs
642 #define nfsd3_fhandleargs nfsd_fhandle
643 #define nfsd3_fhandleres nfsd3_attrstat
644 #define nfsd3_attrstatres nfsd3_attrstat
645 #define nfsd3_wccstatres nfsd3_attrstat
646 #define nfsd3_createres nfsd3_diropres
647 #define nfsd3_voidres nfsd3_voidargs
648 struct nfsd3_voidargs
{ int dummy
; };
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), \
662 #define ST 1 /* status*/
663 #define FH 17 /* filehandle with length */
664 #define AT 21 /* attributes */
665 #define pAT (1+AT) /* post attributes - conditional */
666 #define WC (7+pAT) /* WCC attributes */
668 static struct svc_procedure nfsd_procedures3
[22] = {
670 .pc_func
= (svc_procfunc
) nfsd3_proc_null
,
671 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_voidres
,
672 .pc_argsize
= sizeof(struct nfsd3_voidargs
),
673 .pc_ressize
= sizeof(struct nfsd3_voidres
),
674 .pc_cachetype
= RC_NOCACHE
,
677 [NFS3PROC_GETATTR
] = {
678 .pc_func
= (svc_procfunc
) nfsd3_proc_getattr
,
679 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_fhandleargs
,
680 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_attrstatres
,
681 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
682 .pc_argsize
= sizeof(struct nfsd3_fhandleargs
),
683 .pc_ressize
= sizeof(struct nfsd3_attrstatres
),
684 .pc_cachetype
= RC_NOCACHE
,
685 .pc_xdrressize
= ST
+AT
,
687 [NFS3PROC_SETATTR
] = {
688 .pc_func
= (svc_procfunc
) nfsd3_proc_setattr
,
689 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_sattrargs
,
690 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_wccstatres
,
691 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
692 .pc_argsize
= sizeof(struct nfsd3_sattrargs
),
693 .pc_ressize
= sizeof(struct nfsd3_wccstatres
),
694 .pc_cachetype
= RC_REPLBUFF
,
695 .pc_xdrressize
= ST
+WC
,
697 [NFS3PROC_LOOKUP
] = {
698 .pc_func
= (svc_procfunc
) nfsd3_proc_lookup
,
699 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_diropargs
,
700 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_diropres
,
701 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
702 .pc_argsize
= sizeof(struct nfsd3_diropargs
),
703 .pc_ressize
= sizeof(struct nfsd3_diropres
),
704 .pc_cachetype
= RC_NOCACHE
,
705 .pc_xdrressize
= ST
+FH
+pAT
+pAT
,
707 [NFS3PROC_ACCESS
] = {
708 .pc_func
= (svc_procfunc
) nfsd3_proc_access
,
709 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_accessargs
,
710 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_accessres
,
711 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
712 .pc_argsize
= sizeof(struct nfsd3_accessargs
),
713 .pc_ressize
= sizeof(struct nfsd3_accessres
),
714 .pc_cachetype
= RC_NOCACHE
,
715 .pc_xdrressize
= ST
+pAT
+1,
717 [NFS3PROC_READLINK
] = {
718 .pc_func
= (svc_procfunc
) nfsd3_proc_readlink
,
719 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_readlinkargs
,
720 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_readlinkres
,
721 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
722 .pc_argsize
= sizeof(struct nfsd3_readlinkargs
),
723 .pc_ressize
= sizeof(struct nfsd3_readlinkres
),
724 .pc_cachetype
= RC_NOCACHE
,
725 .pc_xdrressize
= ST
+pAT
+1+NFS3_MAXPATHLEN
/4,
728 .pc_func
= (svc_procfunc
) nfsd3_proc_read
,
729 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_readargs
,
730 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_readres
,
731 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
732 .pc_argsize
= sizeof(struct nfsd3_readargs
),
733 .pc_ressize
= sizeof(struct nfsd3_readres
),
734 .pc_cachetype
= RC_NOCACHE
,
735 .pc_xdrressize
= ST
+pAT
+4+NFSSVC_MAXBLKSIZE
/4,
738 .pc_func
= (svc_procfunc
) nfsd3_proc_write
,
739 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_writeargs
,
740 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_writeres
,
741 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
742 .pc_argsize
= sizeof(struct nfsd3_writeargs
),
743 .pc_ressize
= sizeof(struct nfsd3_writeres
),
744 .pc_cachetype
= RC_REPLBUFF
,
745 .pc_xdrressize
= ST
+WC
+4,
747 [NFS3PROC_CREATE
] = {
748 .pc_func
= (svc_procfunc
) nfsd3_proc_create
,
749 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_createargs
,
750 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_createres
,
751 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
752 .pc_argsize
= sizeof(struct nfsd3_createargs
),
753 .pc_ressize
= sizeof(struct nfsd3_createres
),
754 .pc_cachetype
= RC_REPLBUFF
,
755 .pc_xdrressize
= ST
+(1+FH
+pAT
)+WC
,
758 .pc_func
= (svc_procfunc
) nfsd3_proc_mkdir
,
759 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_mkdirargs
,
760 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_createres
,
761 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
762 .pc_argsize
= sizeof(struct nfsd3_mkdirargs
),
763 .pc_ressize
= sizeof(struct nfsd3_createres
),
764 .pc_cachetype
= RC_REPLBUFF
,
765 .pc_xdrressize
= ST
+(1+FH
+pAT
)+WC
,
767 [NFS3PROC_SYMLINK
] = {
768 .pc_func
= (svc_procfunc
) nfsd3_proc_symlink
,
769 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_symlinkargs
,
770 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_createres
,
771 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
772 .pc_argsize
= sizeof(struct nfsd3_symlinkargs
),
773 .pc_ressize
= sizeof(struct nfsd3_createres
),
774 .pc_cachetype
= RC_REPLBUFF
,
775 .pc_xdrressize
= ST
+(1+FH
+pAT
)+WC
,
778 .pc_func
= (svc_procfunc
) nfsd3_proc_mknod
,
779 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_mknodargs
,
780 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_createres
,
781 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
782 .pc_argsize
= sizeof(struct nfsd3_mknodargs
),
783 .pc_ressize
= sizeof(struct nfsd3_createres
),
784 .pc_cachetype
= RC_REPLBUFF
,
785 .pc_xdrressize
= ST
+(1+FH
+pAT
)+WC
,
787 [NFS3PROC_REMOVE
] = {
788 .pc_func
= (svc_procfunc
) nfsd3_proc_remove
,
789 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_diropargs
,
790 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_wccstatres
,
791 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
792 .pc_argsize
= sizeof(struct nfsd3_diropargs
),
793 .pc_ressize
= sizeof(struct nfsd3_wccstatres
),
794 .pc_cachetype
= RC_REPLBUFF
,
795 .pc_xdrressize
= ST
+WC
,
798 .pc_func
= (svc_procfunc
) nfsd3_proc_rmdir
,
799 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_diropargs
,
800 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_wccstatres
,
801 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
802 .pc_argsize
= sizeof(struct nfsd3_diropargs
),
803 .pc_ressize
= sizeof(struct nfsd3_wccstatres
),
804 .pc_cachetype
= RC_REPLBUFF
,
805 .pc_xdrressize
= ST
+WC
,
807 [NFS3PROC_RENAME
] = {
808 .pc_func
= (svc_procfunc
) nfsd3_proc_rename
,
809 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_renameargs
,
810 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_renameres
,
811 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
812 .pc_argsize
= sizeof(struct nfsd3_renameargs
),
813 .pc_ressize
= sizeof(struct nfsd3_renameres
),
814 .pc_cachetype
= RC_REPLBUFF
,
815 .pc_xdrressize
= ST
+WC
+WC
,
818 .pc_func
= (svc_procfunc
) nfsd3_proc_link
,
819 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_linkargs
,
820 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_linkres
,
821 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle2
,
822 .pc_argsize
= sizeof(struct nfsd3_linkargs
),
823 .pc_ressize
= sizeof(struct nfsd3_linkres
),
824 .pc_cachetype
= RC_REPLBUFF
,
825 .pc_xdrressize
= ST
+pAT
+WC
,
827 [NFS3PROC_READDIR
] = {
828 .pc_func
= (svc_procfunc
) nfsd3_proc_readdir
,
829 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_readdirargs
,
830 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_readdirres
,
831 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
832 .pc_argsize
= sizeof(struct nfsd3_readdirargs
),
833 .pc_ressize
= sizeof(struct nfsd3_readdirres
),
834 .pc_cachetype
= RC_NOCACHE
,
836 [NFS3PROC_READDIRPLUS
] = {
837 .pc_func
= (svc_procfunc
) nfsd3_proc_readdirplus
,
838 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_readdirplusargs
,
839 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_readdirres
,
840 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
841 .pc_argsize
= sizeof(struct nfsd3_readdirplusargs
),
842 .pc_ressize
= sizeof(struct nfsd3_readdirres
),
843 .pc_cachetype
= RC_NOCACHE
,
845 [NFS3PROC_FSSTAT
] = {
846 .pc_func
= (svc_procfunc
) nfsd3_proc_fsstat
,
847 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_fhandleargs
,
848 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_fsstatres
,
849 .pc_argsize
= sizeof(struct nfsd3_fhandleargs
),
850 .pc_ressize
= sizeof(struct nfsd3_fsstatres
),
851 .pc_cachetype
= RC_NOCACHE
,
852 .pc_xdrressize
= ST
+pAT
+2*6+1,
854 [NFS3PROC_FSINFO
] = {
855 .pc_func
= (svc_procfunc
) nfsd3_proc_fsinfo
,
856 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_fhandleargs
,
857 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_fsinfores
,
858 .pc_argsize
= sizeof(struct nfsd3_fhandleargs
),
859 .pc_ressize
= sizeof(struct nfsd3_fsinfores
),
860 .pc_cachetype
= RC_NOCACHE
,
861 .pc_xdrressize
= ST
+pAT
+12,
863 [NFS3PROC_PATHCONF
] = {
864 .pc_func
= (svc_procfunc
) nfsd3_proc_pathconf
,
865 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_fhandleargs
,
866 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_pathconfres
,
867 .pc_argsize
= sizeof(struct nfsd3_fhandleargs
),
868 .pc_ressize
= sizeof(struct nfsd3_pathconfres
),
869 .pc_cachetype
= RC_NOCACHE
,
870 .pc_xdrressize
= ST
+pAT
+6,
872 [NFS3PROC_COMMIT
] = {
873 .pc_func
= (svc_procfunc
) nfsd3_proc_commit
,
874 .pc_decode
= (kxdrproc_t
) nfs3svc_decode_commitargs
,
875 .pc_encode
= (kxdrproc_t
) nfs3svc_encode_commitres
,
876 .pc_release
= (kxdrproc_t
) nfs3svc_release_fhandle
,
877 .pc_argsize
= sizeof(struct nfsd3_commitargs
),
878 .pc_ressize
= sizeof(struct nfsd3_commitres
),
879 .pc_cachetype
= RC_NOCACHE
,
880 .pc_xdrressize
= ST
+WC
+2,
884 struct svc_version nfsd_version3
= {
887 .vs_proc
= nfsd_procedures3
,
888 .vs_dispatch
= nfsd_dispatch
,
889 .vs_xdrsize
= NFS3_SVC_XDRSIZE
,