1 // SPDX-License-Identifier: GPL-2.0
3 * Process version 3 NFS requests.
9 #include <linux/ext2_fs.h>
10 #include <linux/magic.h>
16 #define NFSDDBG_FACILITY NFSDDBG_PROC
18 #define RETURN_STATUS(st) { resp->status = (st); return (st); }
20 static int nfs3_ftypes[] = {
27 S_IFSOCK, /* NF3SOCK */
28 S_IFIFO, /* NF3FIFO */
35 nfsd3_proc_null(struct svc_rqst *rqstp)
41 * Get a file's attributes
44 nfsd3_proc_getattr(struct svc_rqst *rqstp)
46 struct nfsd_fhandle *argp = rqstp->rq_argp;
47 struct nfsd3_attrstat *resp = rqstp->rq_resp;
50 dprintk("nfsd: GETATTR(3) %s\n",
51 SVCFH_fmt(&argp->fh));
53 fh_copy(&resp->fh, &argp->fh);
54 nfserr = fh_verify(rqstp, &resp->fh, 0,
55 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
57 RETURN_STATUS(nfserr);
59 nfserr = fh_getattr(&resp->fh, &resp->stat);
61 RETURN_STATUS(nfserr);
65 * Set a file's attributes
68 nfsd3_proc_setattr(struct svc_rqst *rqstp)
70 struct nfsd3_sattrargs *argp = rqstp->rq_argp;
71 struct nfsd3_attrstat *resp = rqstp->rq_resp;
74 dprintk("nfsd: SETATTR(3) %s\n",
75 SVCFH_fmt(&argp->fh));
77 fh_copy(&resp->fh, &argp->fh);
78 nfserr = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,
79 argp->check_guard, argp->guardtime);
80 RETURN_STATUS(nfserr);
84 * Look up a path name component
87 nfsd3_proc_lookup(struct svc_rqst *rqstp)
89 struct nfsd3_diropargs *argp = rqstp->rq_argp;
90 struct nfsd3_diropres *resp = rqstp->rq_resp;
93 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
98 fh_copy(&resp->dirfh, &argp->fh);
99 fh_init(&resp->fh, NFS3_FHSIZE);
101 nfserr = nfsd_lookup(rqstp, &resp->dirfh,
105 RETURN_STATUS(nfserr);
112 nfsd3_proc_access(struct svc_rqst *rqstp)
114 struct nfsd3_accessargs *argp = rqstp->rq_argp;
115 struct nfsd3_accessres *resp = rqstp->rq_resp;
118 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
119 SVCFH_fmt(&argp->fh),
122 fh_copy(&resp->fh, &argp->fh);
123 resp->access = argp->access;
124 nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
125 RETURN_STATUS(nfserr);
132 nfsd3_proc_readlink(struct svc_rqst *rqstp)
134 struct nfsd3_readlinkargs *argp = rqstp->rq_argp;
135 struct nfsd3_readlinkres *resp = rqstp->rq_resp;
138 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
140 /* Read the symlink. */
141 fh_copy(&resp->fh, &argp->fh);
142 resp->len = NFS3_MAXPATHLEN;
143 nfserr = nfsd_readlink(rqstp, &resp->fh, argp->buffer, &resp->len);
144 RETURN_STATUS(nfserr);
148 * Read a portion of a file.
151 nfsd3_proc_read(struct svc_rqst *rqstp)
153 struct nfsd3_readargs *argp = rqstp->rq_argp;
154 struct nfsd3_readres *resp = rqstp->rq_resp;
156 u32 max_blocksize = svc_max_payload(rqstp);
157 unsigned long cnt = min(argp->count, max_blocksize);
159 dprintk("nfsd: READ(3) %s %lu bytes at %Lu\n",
160 SVCFH_fmt(&argp->fh),
161 (unsigned long) argp->count,
162 (unsigned long long) argp->offset);
164 /* Obtain buffer pointer for payload.
165 * 1 (status) + 22 (post_op_attr) + 1 (count) + 1 (eof)
166 * + 1 (xdr opaque byte count) = 26
169 svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4);
171 fh_copy(&resp->fh, &argp->fh);
172 nfserr = nfsd_read(rqstp, &resp->fh,
174 rqstp->rq_vec, argp->vlen,
177 struct inode *inode = d_inode(resp->fh.fh_dentry);
178 resp->eof = nfsd_eof_on_read(cnt, resp->count, argp->offset,
182 RETURN_STATUS(nfserr);
186 * Write data to a file
189 nfsd3_proc_write(struct svc_rqst *rqstp)
191 struct nfsd3_writeargs *argp = rqstp->rq_argp;
192 struct nfsd3_writeres *resp = rqstp->rq_resp;
194 unsigned long cnt = argp->len;
197 dprintk("nfsd: WRITE(3) %s %d bytes at %Lu%s\n",
198 SVCFH_fmt(&argp->fh),
200 (unsigned long long) argp->offset,
201 argp->stable? " stable" : "");
203 fh_copy(&resp->fh, &argp->fh);
204 resp->committed = argp->stable;
205 nvecs = svc_fill_write_vector(rqstp, rqstp->rq_arg.pages,
208 RETURN_STATUS(nfserr_io);
209 nfserr = nfsd_write(rqstp, &resp->fh, argp->offset,
210 rqstp->rq_vec, nvecs, &cnt,
213 RETURN_STATUS(nfserr);
217 * With NFSv3, CREATE processing is a lot easier than with NFSv2.
218 * At least in theory; we'll see how it fares in practice when the
219 * first reports about SunOS compatibility problems start to pour in...
222 nfsd3_proc_create(struct svc_rqst *rqstp)
224 struct nfsd3_createargs *argp = rqstp->rq_argp;
225 struct nfsd3_diropres *resp = rqstp->rq_resp;
226 svc_fh *dirfhp, *newfhp = NULL;
230 dprintk("nfsd: CREATE(3) %s %.*s\n",
231 SVCFH_fmt(&argp->fh),
235 dirfhp = fh_copy(&resp->dirfh, &argp->fh);
236 newfhp = fh_init(&resp->fh, NFS3_FHSIZE);
239 /* Unfudge the mode bits */
240 attr->ia_mode &= ~S_IFMT;
241 if (!(attr->ia_valid & ATTR_MODE)) {
242 attr->ia_valid |= ATTR_MODE;
243 attr->ia_mode = S_IFREG;
245 attr->ia_mode = (attr->ia_mode & ~S_IFMT) | S_IFREG;
248 /* Now create the file and set attributes */
249 nfserr = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
251 argp->createmode, (u32 *)argp->verf, NULL, NULL);
253 RETURN_STATUS(nfserr);
257 * Make directory. This operation is not idempotent.
260 nfsd3_proc_mkdir(struct svc_rqst *rqstp)
262 struct nfsd3_createargs *argp = rqstp->rq_argp;
263 struct nfsd3_diropres *resp = rqstp->rq_resp;
266 dprintk("nfsd: MKDIR(3) %s %.*s\n",
267 SVCFH_fmt(&argp->fh),
271 argp->attrs.ia_valid &= ~ATTR_SIZE;
272 fh_copy(&resp->dirfh, &argp->fh);
273 fh_init(&resp->fh, NFS3_FHSIZE);
274 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
275 &argp->attrs, S_IFDIR, 0, &resp->fh);
276 fh_unlock(&resp->dirfh);
277 RETURN_STATUS(nfserr);
281 nfsd3_proc_symlink(struct svc_rqst *rqstp)
283 struct nfsd3_symlinkargs *argp = rqstp->rq_argp;
284 struct nfsd3_diropres *resp = rqstp->rq_resp;
288 RETURN_STATUS(nfserr_inval);
289 if (argp->tlen > NFS3_MAXPATHLEN)
290 RETURN_STATUS(nfserr_nametoolong);
292 argp->tname = svc_fill_symlink_pathname(rqstp, &argp->first,
293 page_address(rqstp->rq_arg.pages[0]),
295 if (IS_ERR(argp->tname))
296 RETURN_STATUS(nfserrno(PTR_ERR(argp->tname)));
298 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
299 SVCFH_fmt(&argp->ffh),
300 argp->flen, argp->fname,
301 argp->tlen, argp->tname);
303 fh_copy(&resp->dirfh, &argp->ffh);
304 fh_init(&resp->fh, NFS3_FHSIZE);
305 nfserr = nfsd_symlink(rqstp, &resp->dirfh, argp->fname, argp->flen,
306 argp->tname, &resp->fh);
308 RETURN_STATUS(nfserr);
312 * Make socket/fifo/device.
315 nfsd3_proc_mknod(struct svc_rqst *rqstp)
317 struct nfsd3_mknodargs *argp = rqstp->rq_argp;
318 struct nfsd3_diropres *resp = rqstp->rq_resp;
323 dprintk("nfsd: MKNOD(3) %s %.*s\n",
324 SVCFH_fmt(&argp->fh),
328 fh_copy(&resp->dirfh, &argp->fh);
329 fh_init(&resp->fh, NFS3_FHSIZE);
331 if (argp->ftype == 0 || argp->ftype >= NF3BAD)
332 RETURN_STATUS(nfserr_inval);
333 if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
334 rdev = MKDEV(argp->major, argp->minor);
335 if (MAJOR(rdev) != argp->major ||
336 MINOR(rdev) != argp->minor)
337 RETURN_STATUS(nfserr_inval);
339 if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO)
340 RETURN_STATUS(nfserr_inval);
342 type = nfs3_ftypes[argp->ftype];
343 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
344 &argp->attrs, type, rdev, &resp->fh);
345 fh_unlock(&resp->dirfh);
346 RETURN_STATUS(nfserr);
350 * Remove file/fifo/socket etc.
353 nfsd3_proc_remove(struct svc_rqst *rqstp)
355 struct nfsd3_diropargs *argp = rqstp->rq_argp;
356 struct nfsd3_attrstat *resp = rqstp->rq_resp;
359 dprintk("nfsd: REMOVE(3) %s %.*s\n",
360 SVCFH_fmt(&argp->fh),
364 /* Unlink. -S_IFDIR means file must not be a directory */
365 fh_copy(&resp->fh, &argp->fh);
366 nfserr = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR, argp->name, argp->len);
367 fh_unlock(&resp->fh);
368 RETURN_STATUS(nfserr);
375 nfsd3_proc_rmdir(struct svc_rqst *rqstp)
377 struct nfsd3_diropargs *argp = rqstp->rq_argp;
378 struct nfsd3_attrstat *resp = rqstp->rq_resp;
381 dprintk("nfsd: RMDIR(3) %s %.*s\n",
382 SVCFH_fmt(&argp->fh),
386 fh_copy(&resp->fh, &argp->fh);
387 nfserr = nfsd_unlink(rqstp, &resp->fh, S_IFDIR, argp->name, argp->len);
388 fh_unlock(&resp->fh);
389 RETURN_STATUS(nfserr);
393 nfsd3_proc_rename(struct svc_rqst *rqstp)
395 struct nfsd3_renameargs *argp = rqstp->rq_argp;
396 struct nfsd3_renameres *resp = rqstp->rq_resp;
399 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
400 SVCFH_fmt(&argp->ffh),
403 dprintk("nfsd: -> %s %.*s\n",
404 SVCFH_fmt(&argp->tfh),
408 fh_copy(&resp->ffh, &argp->ffh);
409 fh_copy(&resp->tfh, &argp->tfh);
410 nfserr = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
411 &resp->tfh, argp->tname, argp->tlen);
412 RETURN_STATUS(nfserr);
416 nfsd3_proc_link(struct svc_rqst *rqstp)
418 struct nfsd3_linkargs *argp = rqstp->rq_argp;
419 struct nfsd3_linkres *resp = rqstp->rq_resp;
422 dprintk("nfsd: LINK(3) %s ->\n",
423 SVCFH_fmt(&argp->ffh));
424 dprintk("nfsd: -> %s %.*s\n",
425 SVCFH_fmt(&argp->tfh),
429 fh_copy(&resp->fh, &argp->ffh);
430 fh_copy(&resp->tfh, &argp->tfh);
431 nfserr = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
433 RETURN_STATUS(nfserr);
437 * Read a portion of a directory.
440 nfsd3_proc_readdir(struct svc_rqst *rqstp)
442 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
443 struct nfsd3_readdirres *resp = rqstp->rq_resp;
447 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
448 SVCFH_fmt(&argp->fh),
449 argp->count, (u32) argp->cookie);
451 /* Make sure we've room for the NULL ptr & eof flag, and shrink to
452 * client read size */
453 count = (argp->count >> 2) - 2;
455 /* Read directory and encode entries on the fly */
456 fh_copy(&resp->fh, &argp->fh);
458 resp->buflen = count;
459 resp->common.err = nfs_ok;
460 resp->buffer = argp->buffer;
462 nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie,
463 &resp->common, nfs3svc_encode_entry);
464 memcpy(resp->verf, argp->verf, 8);
465 resp->count = resp->buffer - argp->buffer;
467 loff_t offset = argp->cookie;
469 if (unlikely(resp->offset1)) {
470 /* we ended up with offset on a page boundary */
471 *resp->offset = htonl(offset >> 32);
472 *resp->offset1 = htonl(offset & 0xffffffff);
473 resp->offset1 = NULL;
475 xdr_encode_hyper(resp->offset, offset);
480 RETURN_STATUS(nfserr);
484 * Read a portion of a directory, including file handles and attrs.
485 * For now, we choose to ignore the dircount parameter.
488 nfsd3_proc_readdirplus(struct svc_rqst *rqstp)
490 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
491 struct nfsd3_readdirres *resp = rqstp->rq_resp;
496 caddr_t page_addr = NULL;
498 dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
499 SVCFH_fmt(&argp->fh),
500 argp->count, (u32) argp->cookie);
502 /* Convert byte count to number of words (i.e. >> 2),
503 * and reserve room for the NULL ptr & eof flag (-2 words) */
504 resp->count = (argp->count >> 2) - 2;
506 /* Read directory and encode entries on the fly */
507 fh_copy(&resp->fh, &argp->fh);
509 resp->common.err = nfs_ok;
510 resp->buffer = argp->buffer;
511 resp->buflen = resp->count;
513 offset = argp->cookie;
515 nfserr = fh_verify(rqstp, &resp->fh, S_IFDIR, NFSD_MAY_NOP);
517 RETURN_STATUS(nfserr);
519 if (resp->fh.fh_export->ex_flags & NFSEXP_NOREADDIRPLUS)
520 RETURN_STATUS(nfserr_notsupp);
522 nfserr = nfsd_readdir(rqstp, &resp->fh,
525 nfs3svc_encode_entry_plus);
526 memcpy(resp->verf, argp->verf, 8);
527 for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
528 page_addr = page_address(*p);
530 if (((caddr_t)resp->buffer >= page_addr) &&
531 ((caddr_t)resp->buffer < page_addr + PAGE_SIZE)) {
532 count += (caddr_t)resp->buffer - page_addr;
537 resp->count = count >> 2;
539 if (unlikely(resp->offset1)) {
540 /* we ended up with offset on a page boundary */
541 *resp->offset = htonl(offset >> 32);
542 *resp->offset1 = htonl(offset & 0xffffffff);
543 resp->offset1 = NULL;
545 xdr_encode_hyper(resp->offset, offset);
550 RETURN_STATUS(nfserr);
554 * Get file system stats
557 nfsd3_proc_fsstat(struct svc_rqst *rqstp)
559 struct nfsd_fhandle *argp = rqstp->rq_argp;
560 struct nfsd3_fsstatres *resp = rqstp->rq_resp;
563 dprintk("nfsd: FSSTAT(3) %s\n",
564 SVCFH_fmt(&argp->fh));
566 nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
568 RETURN_STATUS(nfserr);
572 * Get file system info
575 nfsd3_proc_fsinfo(struct svc_rqst *rqstp)
577 struct nfsd_fhandle *argp = rqstp->rq_argp;
578 struct nfsd3_fsinfores *resp = rqstp->rq_resp;
580 u32 max_blocksize = svc_max_payload(rqstp);
582 dprintk("nfsd: FSINFO(3) %s\n",
583 SVCFH_fmt(&argp->fh));
585 resp->f_rtmax = max_blocksize;
586 resp->f_rtpref = max_blocksize;
587 resp->f_rtmult = PAGE_SIZE;
588 resp->f_wtmax = max_blocksize;
589 resp->f_wtpref = max_blocksize;
590 resp->f_wtmult = PAGE_SIZE;
591 resp->f_dtpref = PAGE_SIZE;
592 resp->f_maxfilesize = ~(u32) 0;
593 resp->f_properties = NFS3_FSF_DEFAULT;
595 nfserr = fh_verify(rqstp, &argp->fh, 0,
596 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
598 /* Check special features of the file system. May request
599 * different read/write sizes for file systems known to have
600 * problems with large blocks */
602 struct super_block *sb = argp->fh.fh_dentry->d_sb;
604 /* Note that we don't care for remote fs's here */
605 if (sb->s_magic == MSDOS_SUPER_MAGIC) {
606 resp->f_properties = NFS3_FSF_BILLYBOY;
608 resp->f_maxfilesize = sb->s_maxbytes;
612 RETURN_STATUS(nfserr);
616 * Get pathconf info for the specified file
619 nfsd3_proc_pathconf(struct svc_rqst *rqstp)
621 struct nfsd_fhandle *argp = rqstp->rq_argp;
622 struct nfsd3_pathconfres *resp = rqstp->rq_resp;
625 dprintk("nfsd: PATHCONF(3) %s\n",
626 SVCFH_fmt(&argp->fh));
628 /* Set default pathconf */
629 resp->p_link_max = 255; /* at least */
630 resp->p_name_max = 255; /* at least */
631 resp->p_no_trunc = 0;
632 resp->p_chown_restricted = 1;
633 resp->p_case_insensitive = 0;
634 resp->p_case_preserving = 1;
636 nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
639 struct super_block *sb = argp->fh.fh_dentry->d_sb;
641 /* Note that we don't care for remote fs's here */
642 switch (sb->s_magic) {
643 case EXT2_SUPER_MAGIC:
644 resp->p_link_max = EXT2_LINK_MAX;
645 resp->p_name_max = EXT2_NAME_LEN;
647 case MSDOS_SUPER_MAGIC:
648 resp->p_case_insensitive = 1;
649 resp->p_case_preserving = 0;
655 RETURN_STATUS(nfserr);
660 * Commit a file (range) to stable storage.
663 nfsd3_proc_commit(struct svc_rqst *rqstp)
665 struct nfsd3_commitargs *argp = rqstp->rq_argp;
666 struct nfsd3_commitres *resp = rqstp->rq_resp;
669 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
670 SVCFH_fmt(&argp->fh),
672 (unsigned long long) argp->offset);
674 if (argp->offset > NFS_OFFSET_MAX)
675 RETURN_STATUS(nfserr_inval);
677 fh_copy(&resp->fh, &argp->fh);
678 nfserr = nfsd_commit(rqstp, &resp->fh, argp->offset, argp->count);
680 RETURN_STATUS(nfserr);
685 * NFSv3 Server procedures.
686 * Only the results of non-idempotent operations are cached.
688 #define nfs3svc_decode_fhandleargs nfs3svc_decode_fhandle
689 #define nfs3svc_encode_attrstatres nfs3svc_encode_attrstat
690 #define nfs3svc_encode_wccstatres nfs3svc_encode_wccstat
691 #define nfsd3_mkdirargs nfsd3_createargs
692 #define nfsd3_readdirplusargs nfsd3_readdirargs
693 #define nfsd3_fhandleargs nfsd_fhandle
694 #define nfsd3_fhandleres nfsd3_attrstat
695 #define nfsd3_attrstatres nfsd3_attrstat
696 #define nfsd3_wccstatres nfsd3_attrstat
697 #define nfsd3_createres nfsd3_diropres
698 #define nfsd3_voidres nfsd3_voidargs
699 struct nfsd3_voidargs { int dummy; };
701 #define ST 1 /* status*/
702 #define FH 17 /* filehandle with length */
703 #define AT 21 /* attributes */
704 #define pAT (1+AT) /* post attributes - conditional */
705 #define WC (7+pAT) /* WCC attributes */
707 static const struct svc_procedure nfsd_procedures3[22] = {
709 .pc_func = nfsd3_proc_null,
710 .pc_encode = nfs3svc_encode_voidres,
711 .pc_argsize = sizeof(struct nfsd3_voidargs),
712 .pc_ressize = sizeof(struct nfsd3_voidres),
713 .pc_cachetype = RC_NOCACHE,
716 [NFS3PROC_GETATTR] = {
717 .pc_func = nfsd3_proc_getattr,
718 .pc_decode = nfs3svc_decode_fhandleargs,
719 .pc_encode = nfs3svc_encode_attrstatres,
720 .pc_release = nfs3svc_release_fhandle,
721 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
722 .pc_ressize = sizeof(struct nfsd3_attrstatres),
723 .pc_cachetype = RC_NOCACHE,
724 .pc_xdrressize = ST+AT,
726 [NFS3PROC_SETATTR] = {
727 .pc_func = nfsd3_proc_setattr,
728 .pc_decode = nfs3svc_decode_sattrargs,
729 .pc_encode = nfs3svc_encode_wccstatres,
730 .pc_release = nfs3svc_release_fhandle,
731 .pc_argsize = sizeof(struct nfsd3_sattrargs),
732 .pc_ressize = sizeof(struct nfsd3_wccstatres),
733 .pc_cachetype = RC_REPLBUFF,
734 .pc_xdrressize = ST+WC,
736 [NFS3PROC_LOOKUP] = {
737 .pc_func = nfsd3_proc_lookup,
738 .pc_decode = nfs3svc_decode_diropargs,
739 .pc_encode = nfs3svc_encode_diropres,
740 .pc_release = nfs3svc_release_fhandle2,
741 .pc_argsize = sizeof(struct nfsd3_diropargs),
742 .pc_ressize = sizeof(struct nfsd3_diropres),
743 .pc_cachetype = RC_NOCACHE,
744 .pc_xdrressize = ST+FH+pAT+pAT,
746 [NFS3PROC_ACCESS] = {
747 .pc_func = nfsd3_proc_access,
748 .pc_decode = nfs3svc_decode_accessargs,
749 .pc_encode = nfs3svc_encode_accessres,
750 .pc_release = nfs3svc_release_fhandle,
751 .pc_argsize = sizeof(struct nfsd3_accessargs),
752 .pc_ressize = sizeof(struct nfsd3_accessres),
753 .pc_cachetype = RC_NOCACHE,
754 .pc_xdrressize = ST+pAT+1,
756 [NFS3PROC_READLINK] = {
757 .pc_func = nfsd3_proc_readlink,
758 .pc_decode = nfs3svc_decode_readlinkargs,
759 .pc_encode = nfs3svc_encode_readlinkres,
760 .pc_release = nfs3svc_release_fhandle,
761 .pc_argsize = sizeof(struct nfsd3_readlinkargs),
762 .pc_ressize = sizeof(struct nfsd3_readlinkres),
763 .pc_cachetype = RC_NOCACHE,
764 .pc_xdrressize = ST+pAT+1+NFS3_MAXPATHLEN/4,
767 .pc_func = nfsd3_proc_read,
768 .pc_decode = nfs3svc_decode_readargs,
769 .pc_encode = nfs3svc_encode_readres,
770 .pc_release = nfs3svc_release_fhandle,
771 .pc_argsize = sizeof(struct nfsd3_readargs),
772 .pc_ressize = sizeof(struct nfsd3_readres),
773 .pc_cachetype = RC_NOCACHE,
774 .pc_xdrressize = ST+pAT+4+NFSSVC_MAXBLKSIZE/4,
777 .pc_func = nfsd3_proc_write,
778 .pc_decode = nfs3svc_decode_writeargs,
779 .pc_encode = nfs3svc_encode_writeres,
780 .pc_release = nfs3svc_release_fhandle,
781 .pc_argsize = sizeof(struct nfsd3_writeargs),
782 .pc_ressize = sizeof(struct nfsd3_writeres),
783 .pc_cachetype = RC_REPLBUFF,
784 .pc_xdrressize = ST+WC+4,
786 [NFS3PROC_CREATE] = {
787 .pc_func = nfsd3_proc_create,
788 .pc_decode = nfs3svc_decode_createargs,
789 .pc_encode = nfs3svc_encode_createres,
790 .pc_release = nfs3svc_release_fhandle2,
791 .pc_argsize = sizeof(struct nfsd3_createargs),
792 .pc_ressize = sizeof(struct nfsd3_createres),
793 .pc_cachetype = RC_REPLBUFF,
794 .pc_xdrressize = ST+(1+FH+pAT)+WC,
797 .pc_func = nfsd3_proc_mkdir,
798 .pc_decode = nfs3svc_decode_mkdirargs,
799 .pc_encode = nfs3svc_encode_createres,
800 .pc_release = nfs3svc_release_fhandle2,
801 .pc_argsize = sizeof(struct nfsd3_mkdirargs),
802 .pc_ressize = sizeof(struct nfsd3_createres),
803 .pc_cachetype = RC_REPLBUFF,
804 .pc_xdrressize = ST+(1+FH+pAT)+WC,
806 [NFS3PROC_SYMLINK] = {
807 .pc_func = nfsd3_proc_symlink,
808 .pc_decode = nfs3svc_decode_symlinkargs,
809 .pc_encode = nfs3svc_encode_createres,
810 .pc_release = nfs3svc_release_fhandle2,
811 .pc_argsize = sizeof(struct nfsd3_symlinkargs),
812 .pc_ressize = sizeof(struct nfsd3_createres),
813 .pc_cachetype = RC_REPLBUFF,
814 .pc_xdrressize = ST+(1+FH+pAT)+WC,
817 .pc_func = nfsd3_proc_mknod,
818 .pc_decode = nfs3svc_decode_mknodargs,
819 .pc_encode = nfs3svc_encode_createres,
820 .pc_release = nfs3svc_release_fhandle2,
821 .pc_argsize = sizeof(struct nfsd3_mknodargs),
822 .pc_ressize = sizeof(struct nfsd3_createres),
823 .pc_cachetype = RC_REPLBUFF,
824 .pc_xdrressize = ST+(1+FH+pAT)+WC,
826 [NFS3PROC_REMOVE] = {
827 .pc_func = nfsd3_proc_remove,
828 .pc_decode = nfs3svc_decode_diropargs,
829 .pc_encode = nfs3svc_encode_wccstatres,
830 .pc_release = nfs3svc_release_fhandle,
831 .pc_argsize = sizeof(struct nfsd3_diropargs),
832 .pc_ressize = sizeof(struct nfsd3_wccstatres),
833 .pc_cachetype = RC_REPLBUFF,
834 .pc_xdrressize = ST+WC,
837 .pc_func = nfsd3_proc_rmdir,
838 .pc_decode = nfs3svc_decode_diropargs,
839 .pc_encode = nfs3svc_encode_wccstatres,
840 .pc_release = nfs3svc_release_fhandle,
841 .pc_argsize = sizeof(struct nfsd3_diropargs),
842 .pc_ressize = sizeof(struct nfsd3_wccstatres),
843 .pc_cachetype = RC_REPLBUFF,
844 .pc_xdrressize = ST+WC,
846 [NFS3PROC_RENAME] = {
847 .pc_func = nfsd3_proc_rename,
848 .pc_decode = nfs3svc_decode_renameargs,
849 .pc_encode = nfs3svc_encode_renameres,
850 .pc_release = nfs3svc_release_fhandle2,
851 .pc_argsize = sizeof(struct nfsd3_renameargs),
852 .pc_ressize = sizeof(struct nfsd3_renameres),
853 .pc_cachetype = RC_REPLBUFF,
854 .pc_xdrressize = ST+WC+WC,
857 .pc_func = nfsd3_proc_link,
858 .pc_decode = nfs3svc_decode_linkargs,
859 .pc_encode = nfs3svc_encode_linkres,
860 .pc_release = nfs3svc_release_fhandle2,
861 .pc_argsize = sizeof(struct nfsd3_linkargs),
862 .pc_ressize = sizeof(struct nfsd3_linkres),
863 .pc_cachetype = RC_REPLBUFF,
864 .pc_xdrressize = ST+pAT+WC,
866 [NFS3PROC_READDIR] = {
867 .pc_func = nfsd3_proc_readdir,
868 .pc_decode = nfs3svc_decode_readdirargs,
869 .pc_encode = nfs3svc_encode_readdirres,
870 .pc_release = nfs3svc_release_fhandle,
871 .pc_argsize = sizeof(struct nfsd3_readdirargs),
872 .pc_ressize = sizeof(struct nfsd3_readdirres),
873 .pc_cachetype = RC_NOCACHE,
875 [NFS3PROC_READDIRPLUS] = {
876 .pc_func = nfsd3_proc_readdirplus,
877 .pc_decode = nfs3svc_decode_readdirplusargs,
878 .pc_encode = nfs3svc_encode_readdirres,
879 .pc_release = nfs3svc_release_fhandle,
880 .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
881 .pc_ressize = sizeof(struct nfsd3_readdirres),
882 .pc_cachetype = RC_NOCACHE,
884 [NFS3PROC_FSSTAT] = {
885 .pc_func = nfsd3_proc_fsstat,
886 .pc_decode = nfs3svc_decode_fhandleargs,
887 .pc_encode = nfs3svc_encode_fsstatres,
888 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
889 .pc_ressize = sizeof(struct nfsd3_fsstatres),
890 .pc_cachetype = RC_NOCACHE,
891 .pc_xdrressize = ST+pAT+2*6+1,
893 [NFS3PROC_FSINFO] = {
894 .pc_func = nfsd3_proc_fsinfo,
895 .pc_decode = nfs3svc_decode_fhandleargs,
896 .pc_encode = nfs3svc_encode_fsinfores,
897 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
898 .pc_ressize = sizeof(struct nfsd3_fsinfores),
899 .pc_cachetype = RC_NOCACHE,
900 .pc_xdrressize = ST+pAT+12,
902 [NFS3PROC_PATHCONF] = {
903 .pc_func = nfsd3_proc_pathconf,
904 .pc_decode = nfs3svc_decode_fhandleargs,
905 .pc_encode = nfs3svc_encode_pathconfres,
906 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
907 .pc_ressize = sizeof(struct nfsd3_pathconfres),
908 .pc_cachetype = RC_NOCACHE,
909 .pc_xdrressize = ST+pAT+6,
911 [NFS3PROC_COMMIT] = {
912 .pc_func = nfsd3_proc_commit,
913 .pc_decode = nfs3svc_decode_commitargs,
914 .pc_encode = nfs3svc_encode_commitres,
915 .pc_release = nfs3svc_release_fhandle,
916 .pc_argsize = sizeof(struct nfsd3_commitargs),
917 .pc_ressize = sizeof(struct nfsd3_commitres),
918 .pc_cachetype = RC_NOCACHE,
919 .pc_xdrressize = ST+WC+2,
923 static unsigned int nfsd_count3[ARRAY_SIZE(nfsd_procedures3)];
924 const struct svc_version nfsd_version3 = {
927 .vs_proc = nfsd_procedures3,
928 .vs_dispatch = nfsd_dispatch,
929 .vs_count = nfsd_count3,
930 .vs_xdrsize = NFS3_SVC_XDRSIZE,