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);
151 dprintk("nfsd: READ(3) %s %lu bytes at %Lu\n",
152 SVCFH_fmt(&argp->fh),
153 (unsigned long) argp->count,
154 (unsigned long long) argp->offset);
156 /* Obtain buffer pointer for payload.
157 * 1 (status) + 22 (post_op_attr) + 1 (count) + 1 (eof)
158 * + 1 (xdr opaque byte count) = 26
160 resp->count = min(argp->count, max_blocksize);
161 svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4);
163 fh_copy(&resp->fh, &argp->fh);
164 nfserr = nfsd_read(rqstp, &resp->fh,
166 rqstp->rq_vec, argp->vlen,
169 struct inode *inode = resp->fh.fh_dentry->d_inode;
171 resp->eof = (argp->offset + resp->count) >= inode->i_size;
174 RETURN_STATUS(nfserr);
178 * Write data to a file
181 nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
182 struct nfsd3_writeres *resp)
185 unsigned long cnt = argp->len;
187 dprintk("nfsd: WRITE(3) %s %d bytes at %Lu%s\n",
188 SVCFH_fmt(&argp->fh),
190 (unsigned long long) argp->offset,
191 argp->stable? " stable" : "");
193 fh_copy(&resp->fh, &argp->fh);
194 resp->committed = argp->stable;
195 nfserr = nfsd_write(rqstp, &resp->fh, NULL,
197 rqstp->rq_vec, argp->vlen,
201 RETURN_STATUS(nfserr);
205 * With NFSv3, CREATE processing is a lot easier than with NFSv2.
206 * At least in theory; we'll see how it fares in practice when the
207 * first reports about SunOS compatibility problems start to pour in...
210 nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
211 struct nfsd3_diropres *resp)
213 svc_fh *dirfhp, *newfhp = NULL;
217 dprintk("nfsd: CREATE(3) %s %.*s\n",
218 SVCFH_fmt(&argp->fh),
222 dirfhp = fh_copy(&resp->dirfh, &argp->fh);
223 newfhp = fh_init(&resp->fh, NFS3_FHSIZE);
226 /* Get the directory inode */
227 nfserr = fh_verify(rqstp, dirfhp, S_IFDIR, NFSD_MAY_CREATE);
229 RETURN_STATUS(nfserr);
231 /* Unfudge the mode bits */
232 attr->ia_mode &= ~S_IFMT;
233 if (!(attr->ia_valid & ATTR_MODE)) {
234 attr->ia_valid |= ATTR_MODE;
235 attr->ia_mode = S_IFREG;
237 attr->ia_mode = (attr->ia_mode & ~S_IFMT) | S_IFREG;
240 /* Now create the file and set attributes */
241 nfserr = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
243 argp->createmode, (u32 *)argp->verf, NULL, NULL);
245 RETURN_STATUS(nfserr);
249 * Make directory. This operation is not idempotent.
252 nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
253 struct nfsd3_diropres *resp)
257 dprintk("nfsd: MKDIR(3) %s %.*s\n",
258 SVCFH_fmt(&argp->fh),
262 argp->attrs.ia_valid &= ~ATTR_SIZE;
263 fh_copy(&resp->dirfh, &argp->fh);
264 fh_init(&resp->fh, NFS3_FHSIZE);
265 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
266 &argp->attrs, S_IFDIR, 0, &resp->fh);
267 fh_unlock(&resp->dirfh);
268 RETURN_STATUS(nfserr);
272 nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
273 struct nfsd3_diropres *resp)
277 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
278 SVCFH_fmt(&argp->ffh),
279 argp->flen, argp->fname,
280 argp->tlen, argp->tname);
282 fh_copy(&resp->dirfh, &argp->ffh);
283 fh_init(&resp->fh, NFS3_FHSIZE);
284 nfserr = nfsd_symlink(rqstp, &resp->dirfh, argp->fname, argp->flen,
286 &resp->fh, &argp->attrs);
287 RETURN_STATUS(nfserr);
291 * Make socket/fifo/device.
294 nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
295 struct nfsd3_diropres *resp)
301 dprintk("nfsd: MKNOD(3) %s %.*s\n",
302 SVCFH_fmt(&argp->fh),
306 fh_copy(&resp->dirfh, &argp->fh);
307 fh_init(&resp->fh, NFS3_FHSIZE);
309 if (argp->ftype == 0 || argp->ftype >= NF3BAD)
310 RETURN_STATUS(nfserr_inval);
311 if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
312 rdev = MKDEV(argp->major, argp->minor);
313 if (MAJOR(rdev) != argp->major ||
314 MINOR(rdev) != argp->minor)
315 RETURN_STATUS(nfserr_inval);
317 if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO)
318 RETURN_STATUS(nfserr_inval);
320 type = nfs3_ftypes[argp->ftype];
321 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
322 &argp->attrs, type, rdev, &resp->fh);
323 fh_unlock(&resp->dirfh);
324 RETURN_STATUS(nfserr);
328 * Remove file/fifo/socket etc.
331 nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
332 struct nfsd3_attrstat *resp)
336 dprintk("nfsd: REMOVE(3) %s %.*s\n",
337 SVCFH_fmt(&argp->fh),
341 /* Unlink. -S_IFDIR means file must not be a directory */
342 fh_copy(&resp->fh, &argp->fh);
343 nfserr = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR, argp->name, argp->len);
344 fh_unlock(&resp->fh);
345 RETURN_STATUS(nfserr);
352 nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
353 struct nfsd3_attrstat *resp)
357 dprintk("nfsd: RMDIR(3) %s %.*s\n",
358 SVCFH_fmt(&argp->fh),
362 fh_copy(&resp->fh, &argp->fh);
363 nfserr = nfsd_unlink(rqstp, &resp->fh, S_IFDIR, argp->name, argp->len);
364 fh_unlock(&resp->fh);
365 RETURN_STATUS(nfserr);
369 nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
370 struct nfsd3_renameres *resp)
374 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
375 SVCFH_fmt(&argp->ffh),
378 dprintk("nfsd: -> %s %.*s\n",
379 SVCFH_fmt(&argp->tfh),
383 fh_copy(&resp->ffh, &argp->ffh);
384 fh_copy(&resp->tfh, &argp->tfh);
385 nfserr = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
386 &resp->tfh, argp->tname, argp->tlen);
387 RETURN_STATUS(nfserr);
391 nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
392 struct nfsd3_linkres *resp)
396 dprintk("nfsd: LINK(3) %s ->\n",
397 SVCFH_fmt(&argp->ffh));
398 dprintk("nfsd: -> %s %.*s\n",
399 SVCFH_fmt(&argp->tfh),
403 fh_copy(&resp->fh, &argp->ffh);
404 fh_copy(&resp->tfh, &argp->tfh);
405 nfserr = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
407 RETURN_STATUS(nfserr);
411 * Read a portion of a directory.
414 nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
415 struct nfsd3_readdirres *resp)
420 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
421 SVCFH_fmt(&argp->fh),
422 argp->count, (u32) argp->cookie);
424 /* Make sure we've room for the NULL ptr & eof flag, and shrink to
425 * client read size */
426 count = (argp->count >> 2) - 2;
428 /* Read directory and encode entries on the fly */
429 fh_copy(&resp->fh, &argp->fh);
431 resp->buflen = count;
432 resp->common.err = nfs_ok;
433 resp->buffer = argp->buffer;
435 nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie,
436 &resp->common, nfs3svc_encode_entry);
437 memcpy(resp->verf, argp->verf, 8);
438 resp->count = resp->buffer - argp->buffer;
440 xdr_encode_hyper(resp->offset, argp->cookie);
442 RETURN_STATUS(nfserr);
446 * Read a portion of a directory, including file handles and attrs.
447 * For now, we choose to ignore the dircount parameter.
450 nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
451 struct nfsd3_readdirres *resp)
457 caddr_t page_addr = NULL;
459 dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
460 SVCFH_fmt(&argp->fh),
461 argp->count, (u32) argp->cookie);
463 /* Convert byte count to number of words (i.e. >> 2),
464 * and reserve room for the NULL ptr & eof flag (-2 words) */
465 resp->count = (argp->count >> 2) - 2;
467 /* Read directory and encode entries on the fly */
468 fh_copy(&resp->fh, &argp->fh);
470 resp->common.err = nfs_ok;
471 resp->buffer = argp->buffer;
472 resp->buflen = resp->count;
474 offset = argp->cookie;
475 nfserr = nfsd_readdir(rqstp, &resp->fh,
478 nfs3svc_encode_entry_plus);
479 memcpy(resp->verf, argp->verf, 8);
480 for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
481 page_addr = page_address(*p);
483 if (((caddr_t)resp->buffer >= page_addr) &&
484 ((caddr_t)resp->buffer < page_addr + PAGE_SIZE)) {
485 count += (caddr_t)resp->buffer - page_addr;
490 resp->count = count >> 2;
492 if (unlikely(resp->offset1)) {
493 /* we ended up with offset on a page boundary */
494 *resp->offset = htonl(offset >> 32);
495 *resp->offset1 = htonl(offset & 0xffffffff);
496 resp->offset1 = NULL;
498 xdr_encode_hyper(resp->offset, offset);
502 RETURN_STATUS(nfserr);
506 * Get file system stats
509 nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
510 struct nfsd3_fsstatres *resp)
514 dprintk("nfsd: FSSTAT(3) %s\n",
515 SVCFH_fmt(&argp->fh));
517 nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
519 RETURN_STATUS(nfserr);
523 * Get file system info
526 nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
527 struct nfsd3_fsinfores *resp)
530 u32 max_blocksize = svc_max_payload(rqstp);
532 dprintk("nfsd: FSINFO(3) %s\n",
533 SVCFH_fmt(&argp->fh));
535 resp->f_rtmax = max_blocksize;
536 resp->f_rtpref = max_blocksize;
537 resp->f_rtmult = PAGE_SIZE;
538 resp->f_wtmax = max_blocksize;
539 resp->f_wtpref = max_blocksize;
540 resp->f_wtmult = PAGE_SIZE;
541 resp->f_dtpref = PAGE_SIZE;
542 resp->f_maxfilesize = ~(u32) 0;
543 resp->f_properties = NFS3_FSF_DEFAULT;
545 nfserr = fh_verify(rqstp, &argp->fh, 0,
546 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
548 /* Check special features of the file system. May request
549 * different read/write sizes for file systems known to have
550 * problems with large blocks */
552 struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;
554 /* Note that we don't care for remote fs's here */
555 if (sb->s_magic == MSDOS_SUPER_MAGIC) {
556 resp->f_properties = NFS3_FSF_BILLYBOY;
558 resp->f_maxfilesize = sb->s_maxbytes;
562 RETURN_STATUS(nfserr);
566 * Get pathconf info for the specified file
569 nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
570 struct nfsd3_pathconfres *resp)
574 dprintk("nfsd: PATHCONF(3) %s\n",
575 SVCFH_fmt(&argp->fh));
577 /* Set default pathconf */
578 resp->p_link_max = 255; /* at least */
579 resp->p_name_max = 255; /* at least */
580 resp->p_no_trunc = 0;
581 resp->p_chown_restricted = 1;
582 resp->p_case_insensitive = 0;
583 resp->p_case_preserving = 1;
585 nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
588 struct super_block *sb = argp->fh.fh_dentry->d_inode->i_sb;
590 /* Note that we don't care for remote fs's here */
591 switch (sb->s_magic) {
592 case EXT2_SUPER_MAGIC:
593 resp->p_link_max = EXT2_LINK_MAX;
594 resp->p_name_max = EXT2_NAME_LEN;
596 case MSDOS_SUPER_MAGIC:
597 resp->p_case_insensitive = 1;
598 resp->p_case_preserving = 0;
604 RETURN_STATUS(nfserr);
609 * Commit a file (range) to stable storage.
612 nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp,
613 struct nfsd3_commitres *resp)
617 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
618 SVCFH_fmt(&argp->fh),
620 (unsigned long long) argp->offset);
622 if (argp->offset > NFS_OFFSET_MAX)
623 RETURN_STATUS(nfserr_inval);
625 fh_copy(&resp->fh, &argp->fh);
626 nfserr = nfsd_commit(rqstp, &resp->fh, argp->offset, argp->count);
628 RETURN_STATUS(nfserr);
633 * NFSv3 Server procedures.
634 * Only the results of non-idempotent operations are cached.
636 #define nfs3svc_decode_fhandleargs nfs3svc_decode_fhandle
637 #define nfs3svc_encode_attrstatres nfs3svc_encode_attrstat
638 #define nfs3svc_encode_wccstatres nfs3svc_encode_wccstat
639 #define nfsd3_mkdirargs nfsd3_createargs
640 #define nfsd3_readdirplusargs nfsd3_readdirargs
641 #define nfsd3_fhandleargs nfsd_fhandle
642 #define nfsd3_fhandleres nfsd3_attrstat
643 #define nfsd3_attrstatres nfsd3_attrstat
644 #define nfsd3_wccstatres nfsd3_attrstat
645 #define nfsd3_createres nfsd3_diropres
646 #define nfsd3_voidres nfsd3_voidargs
647 struct nfsd3_voidargs { int dummy; };
649 #define PROC(name, argt, rest, relt, cache, respsize) \
650 { (svc_procfunc) nfsd3_proc_##name, \
651 (kxdrproc_t) nfs3svc_decode_##argt##args, \
652 (kxdrproc_t) nfs3svc_encode_##rest##res, \
653 (kxdrproc_t) nfs3svc_release_##relt, \
654 sizeof(struct nfsd3_##argt##args), \
655 sizeof(struct nfsd3_##rest##res), \
661 #define ST 1 /* status*/
662 #define FH 17 /* filehandle with length */
663 #define AT 21 /* attributes */
664 #define pAT (1+AT) /* post attributes - conditional */
665 #define WC (7+pAT) /* WCC attributes */
667 static struct svc_procedure nfsd_procedures3[22] = {
669 .pc_func = (svc_procfunc) nfsd3_proc_null,
670 .pc_encode = (kxdrproc_t) nfs3svc_encode_voidres,
671 .pc_argsize = sizeof(struct nfsd3_voidargs),
672 .pc_ressize = sizeof(struct nfsd3_voidres),
673 .pc_cachetype = RC_NOCACHE,
676 [NFS3PROC_GETATTR] = {
677 .pc_func = (svc_procfunc) nfsd3_proc_getattr,
678 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
679 .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres,
680 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
681 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
682 .pc_ressize = sizeof(struct nfsd3_attrstatres),
683 .pc_cachetype = RC_NOCACHE,
684 .pc_xdrressize = ST+AT,
686 [NFS3PROC_SETATTR] = {
687 .pc_func = (svc_procfunc) nfsd3_proc_setattr,
688 .pc_decode = (kxdrproc_t) nfs3svc_decode_sattrargs,
689 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
690 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
691 .pc_argsize = sizeof(struct nfsd3_sattrargs),
692 .pc_ressize = sizeof(struct nfsd3_wccstatres),
693 .pc_cachetype = RC_REPLBUFF,
694 .pc_xdrressize = ST+WC,
696 [NFS3PROC_LOOKUP] = {
697 .pc_func = (svc_procfunc) nfsd3_proc_lookup,
698 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
699 .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres,
700 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
701 .pc_argsize = sizeof(struct nfsd3_diropargs),
702 .pc_ressize = sizeof(struct nfsd3_diropres),
703 .pc_cachetype = RC_NOCACHE,
704 .pc_xdrressize = ST+FH+pAT+pAT,
706 [NFS3PROC_ACCESS] = {
707 .pc_func = (svc_procfunc) nfsd3_proc_access,
708 .pc_decode = (kxdrproc_t) nfs3svc_decode_accessargs,
709 .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres,
710 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
711 .pc_argsize = sizeof(struct nfsd3_accessargs),
712 .pc_ressize = sizeof(struct nfsd3_accessres),
713 .pc_cachetype = RC_NOCACHE,
714 .pc_xdrressize = ST+pAT+1,
716 [NFS3PROC_READLINK] = {
717 .pc_func = (svc_procfunc) nfsd3_proc_readlink,
718 .pc_decode = (kxdrproc_t) nfs3svc_decode_readlinkargs,
719 .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres,
720 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
721 .pc_argsize = sizeof(struct nfsd3_readlinkargs),
722 .pc_ressize = sizeof(struct nfsd3_readlinkres),
723 .pc_cachetype = RC_NOCACHE,
724 .pc_xdrressize = ST+pAT+1+NFS3_MAXPATHLEN/4,
727 .pc_func = (svc_procfunc) nfsd3_proc_read,
728 .pc_decode = (kxdrproc_t) nfs3svc_decode_readargs,
729 .pc_encode = (kxdrproc_t) nfs3svc_encode_readres,
730 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
731 .pc_argsize = sizeof(struct nfsd3_readargs),
732 .pc_ressize = sizeof(struct nfsd3_readres),
733 .pc_cachetype = RC_NOCACHE,
734 .pc_xdrressize = ST+pAT+4+NFSSVC_MAXBLKSIZE/4,
737 .pc_func = (svc_procfunc) nfsd3_proc_write,
738 .pc_decode = (kxdrproc_t) nfs3svc_decode_writeargs,
739 .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres,
740 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
741 .pc_argsize = sizeof(struct nfsd3_writeargs),
742 .pc_ressize = sizeof(struct nfsd3_writeres),
743 .pc_cachetype = RC_REPLBUFF,
744 .pc_xdrressize = ST+WC+4,
746 [NFS3PROC_CREATE] = {
747 .pc_func = (svc_procfunc) nfsd3_proc_create,
748 .pc_decode = (kxdrproc_t) nfs3svc_decode_createargs,
749 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
750 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
751 .pc_argsize = sizeof(struct nfsd3_createargs),
752 .pc_ressize = sizeof(struct nfsd3_createres),
753 .pc_cachetype = RC_REPLBUFF,
754 .pc_xdrressize = ST+(1+FH+pAT)+WC,
757 .pc_func = (svc_procfunc) nfsd3_proc_mkdir,
758 .pc_decode = (kxdrproc_t) nfs3svc_decode_mkdirargs,
759 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
760 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
761 .pc_argsize = sizeof(struct nfsd3_mkdirargs),
762 .pc_ressize = sizeof(struct nfsd3_createres),
763 .pc_cachetype = RC_REPLBUFF,
764 .pc_xdrressize = ST+(1+FH+pAT)+WC,
766 [NFS3PROC_SYMLINK] = {
767 .pc_func = (svc_procfunc) nfsd3_proc_symlink,
768 .pc_decode = (kxdrproc_t) nfs3svc_decode_symlinkargs,
769 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
770 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
771 .pc_argsize = sizeof(struct nfsd3_symlinkargs),
772 .pc_ressize = sizeof(struct nfsd3_createres),
773 .pc_cachetype = RC_REPLBUFF,
774 .pc_xdrressize = ST+(1+FH+pAT)+WC,
777 .pc_func = (svc_procfunc) nfsd3_proc_mknod,
778 .pc_decode = (kxdrproc_t) nfs3svc_decode_mknodargs,
779 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
780 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
781 .pc_argsize = sizeof(struct nfsd3_mknodargs),
782 .pc_ressize = sizeof(struct nfsd3_createres),
783 .pc_cachetype = RC_REPLBUFF,
784 .pc_xdrressize = ST+(1+FH+pAT)+WC,
786 [NFS3PROC_REMOVE] = {
787 .pc_func = (svc_procfunc) nfsd3_proc_remove,
788 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
789 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
790 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
791 .pc_argsize = sizeof(struct nfsd3_diropargs),
792 .pc_ressize = sizeof(struct nfsd3_wccstatres),
793 .pc_cachetype = RC_REPLBUFF,
794 .pc_xdrressize = ST+WC,
797 .pc_func = (svc_procfunc) nfsd3_proc_rmdir,
798 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
799 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
800 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
801 .pc_argsize = sizeof(struct nfsd3_diropargs),
802 .pc_ressize = sizeof(struct nfsd3_wccstatres),
803 .pc_cachetype = RC_REPLBUFF,
804 .pc_xdrressize = ST+WC,
806 [NFS3PROC_RENAME] = {
807 .pc_func = (svc_procfunc) nfsd3_proc_rename,
808 .pc_decode = (kxdrproc_t) nfs3svc_decode_renameargs,
809 .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres,
810 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
811 .pc_argsize = sizeof(struct nfsd3_renameargs),
812 .pc_ressize = sizeof(struct nfsd3_renameres),
813 .pc_cachetype = RC_REPLBUFF,
814 .pc_xdrressize = ST+WC+WC,
817 .pc_func = (svc_procfunc) nfsd3_proc_link,
818 .pc_decode = (kxdrproc_t) nfs3svc_decode_linkargs,
819 .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres,
820 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
821 .pc_argsize = sizeof(struct nfsd3_linkargs),
822 .pc_ressize = sizeof(struct nfsd3_linkres),
823 .pc_cachetype = RC_REPLBUFF,
824 .pc_xdrressize = ST+pAT+WC,
826 [NFS3PROC_READDIR] = {
827 .pc_func = (svc_procfunc) nfsd3_proc_readdir,
828 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirargs,
829 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
830 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
831 .pc_argsize = sizeof(struct nfsd3_readdirargs),
832 .pc_ressize = sizeof(struct nfsd3_readdirres),
833 .pc_cachetype = RC_NOCACHE,
835 [NFS3PROC_READDIRPLUS] = {
836 .pc_func = (svc_procfunc) nfsd3_proc_readdirplus,
837 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirplusargs,
838 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
839 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
840 .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
841 .pc_ressize = sizeof(struct nfsd3_readdirres),
842 .pc_cachetype = RC_NOCACHE,
844 [NFS3PROC_FSSTAT] = {
845 .pc_func = (svc_procfunc) nfsd3_proc_fsstat,
846 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
847 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres,
848 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
849 .pc_ressize = sizeof(struct nfsd3_fsstatres),
850 .pc_cachetype = RC_NOCACHE,
851 .pc_xdrressize = ST+pAT+2*6+1,
853 [NFS3PROC_FSINFO] = {
854 .pc_func = (svc_procfunc) nfsd3_proc_fsinfo,
855 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
856 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores,
857 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
858 .pc_ressize = sizeof(struct nfsd3_fsinfores),
859 .pc_cachetype = RC_NOCACHE,
860 .pc_xdrressize = ST+pAT+12,
862 [NFS3PROC_PATHCONF] = {
863 .pc_func = (svc_procfunc) nfsd3_proc_pathconf,
864 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
865 .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres,
866 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
867 .pc_ressize = sizeof(struct nfsd3_pathconfres),
868 .pc_cachetype = RC_NOCACHE,
869 .pc_xdrressize = ST+pAT+6,
871 [NFS3PROC_COMMIT] = {
872 .pc_func = (svc_procfunc) nfsd3_proc_commit,
873 .pc_decode = (kxdrproc_t) nfs3svc_decode_commitargs,
874 .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres,
875 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
876 .pc_argsize = sizeof(struct nfsd3_commitargs),
877 .pc_ressize = sizeof(struct nfsd3_commitres),
878 .pc_cachetype = RC_NOCACHE,
879 .pc_xdrressize = ST+WC+2,
883 struct svc_version nfsd_version3 = {
886 .vs_proc = nfsd_procedures3,
887 .vs_dispatch = nfsd_dispatch,
888 .vs_xdrsize = NFS3_SVC_XDRSIZE,