2 * nfsproc2.c Process version 2 NFS requests.
3 * linux/fs/nfsd/nfs2proc.c
5 * Process version 2 NFS requests.
7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
10 #include <linux/namei.h>
12 #include <linux/nfsd/cache.h>
13 #include <linux/nfsd/xdr.h>
16 typedef struct svc_rqst svc_rqst;
17 typedef struct svc_buf svc_buf;
19 #define NFSDDBG_FACILITY NFSDDBG_PROC
23 nfsd_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
29 nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
32 return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
37 nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
40 return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
45 * Get a file's attributes
46 * N.B. After this call resp->fh needs an fh_put
49 nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
50 struct nfsd_attrstat *resp)
53 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
55 fh_copy(&resp->fh, &argp->fh);
56 nfserr = fh_verify(rqstp, &resp->fh, 0,
57 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
58 return nfsd_return_attrs(nfserr, resp);
62 * Set a file's attributes
63 * N.B. After this call resp->fh needs an fh_put
66 nfsd_proc_setattr(struct svc_rqst *rqstp, struct nfsd_sattrargs *argp,
67 struct nfsd_attrstat *resp)
70 dprintk("nfsd: SETATTR %s, valid=%x, size=%ld\n",
72 argp->attrs.ia_valid, (long) argp->attrs.ia_size);
74 fh_copy(&resp->fh, &argp->fh);
75 nfserr = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,0, (time_t)0);
76 return nfsd_return_attrs(nfserr, resp);
80 * Look up a path name component
81 * Note: the dentry in the resp->fh may be negative if the file
83 * N.B. After this call resp->fh needs an fh_put
86 nfsd_proc_lookup(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
87 struct nfsd_diropres *resp)
91 dprintk("nfsd: LOOKUP %s %.*s\n",
92 SVCFH_fmt(&argp->fh), argp->len, argp->name);
94 fh_init(&resp->fh, NFS_FHSIZE);
95 nfserr = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
99 return nfsd_return_dirop(nfserr, resp);
106 nfsd_proc_readlink(struct svc_rqst *rqstp, struct nfsd_readlinkargs *argp,
107 struct nfsd_readlinkres *resp)
111 dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
113 /* Read the symlink. */
114 resp->len = NFS_MAXPATHLEN;
115 nfserr = nfsd_readlink(rqstp, &argp->fh, argp->buffer, &resp->len);
122 * Read a portion of a file.
123 * N.B. After this call resp->fh needs an fh_put
126 nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
127 struct nfsd_readres *resp)
131 dprintk("nfsd: READ %s %d bytes at %d\n",
132 SVCFH_fmt(&argp->fh),
133 argp->count, argp->offset);
135 /* Obtain buffer pointer for payload. 19 is 1 word for
136 * status, 17 words for fattr, and 1 word for the byte count.
139 if (NFSSVC_MAXBLKSIZE_V2 < argp->count) {
140 char buf[RPC_MAX_ADDRBUFLEN];
142 "oversized read request from %s (%d bytes)\n",
143 svc_print_addr(rqstp, buf, sizeof(buf)),
145 argp->count = NFSSVC_MAXBLKSIZE_V2;
147 svc_reserve_auth(rqstp, (19<<2) + argp->count + 4);
149 resp->count = argp->count;
150 nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
152 rqstp->rq_vec, argp->vlen,
155 if (nfserr) return nfserr;
156 return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
162 * Write data to a file
163 * N.B. After this call resp->fh needs an fh_put
166 nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
167 struct nfsd_attrstat *resp)
171 unsigned long cnt = argp->len;
173 dprintk("nfsd: WRITE %s %d bytes at %d\n",
174 SVCFH_fmt(&argp->fh),
175 argp->len, argp->offset);
177 nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
179 rqstp->rq_vec, argp->vlen,
182 return nfsd_return_attrs(nfserr, resp);
186 * CREATE processing is complicated. The keyword here is `overloaded.'
187 * The parent directory is kept locked between the check for existence
188 * and the actual create() call in compliance with VFS protocols.
189 * N.B. After this call _both_ argp->fh and resp->fh need an fh_put
192 nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
193 struct nfsd_diropres *resp)
195 svc_fh *dirfhp = &argp->fh;
196 svc_fh *newfhp = &resp->fh;
197 struct iattr *attr = &argp->attrs;
199 struct dentry *dchild;
202 dev_t rdev = 0, wanted = new_decode_dev(attr->ia_size);
204 dprintk("nfsd: CREATE %s %.*s\n",
205 SVCFH_fmt(dirfhp), argp->len, argp->name);
207 /* First verify the parent file handle */
208 nfserr = fh_verify(rqstp, dirfhp, S_IFDIR, NFSD_MAY_EXEC);
210 goto done; /* must fh_put dirfhp even on error */
212 /* Check for NFSD_MAY_WRITE in nfsd_create if necessary */
214 nfserr = nfserr_acces;
217 nfserr = nfserr_exist;
218 if (isdotent(argp->name, argp->len))
220 fh_lock_nested(dirfhp, I_MUTEX_PARENT);
221 dchild = lookup_one_len(argp->name, dirfhp->fh_dentry, argp->len);
222 if (IS_ERR(dchild)) {
223 nfserr = nfserrno(PTR_ERR(dchild));
226 fh_init(newfhp, NFS_FHSIZE);
227 nfserr = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp);
228 if (!nfserr && !dchild->d_inode)
229 nfserr = nfserr_noent;
232 if (nfserr != nfserr_noent)
235 * If the new file handle wasn't verified, we can't tell
236 * whether the file exists or not. Time to bail ...
238 nfserr = nfserr_acces;
239 if (!newfhp->fh_dentry) {
241 "nfsd_proc_create: file handle not verified\n");
246 inode = newfhp->fh_dentry->d_inode;
248 /* Unfudge the mode bits */
249 if (attr->ia_valid & ATTR_MODE) {
250 type = attr->ia_mode & S_IFMT;
251 mode = attr->ia_mode & ~S_IFMT;
253 /* no type, so if target exists, assume same as that,
254 * else assume a file */
256 type = inode->i_mode & S_IFMT;
260 /* reserve rdev for later checking */
261 rdev = inode->i_rdev;
262 attr->ia_valid |= ATTR_SIZE;
266 /* this is probably a permission check..
267 * at least IRIX implements perm checking on
268 * echo thing > device-special-file-or-pipe
269 * by doing a CREATE with type==0
271 nfserr = nfsd_permission(rqstp,
274 NFSD_MAY_WRITE|NFSD_MAY_LOCAL_ACCESS);
275 if (nfserr && nfserr != nfserr_rofs)
282 type = inode->i_mode & S_IFMT;
283 mode = inode->i_mode & ~S_IFMT;
289 attr->ia_valid |= ATTR_MODE;
290 attr->ia_mode = mode;
292 /* Special treatment for non-regular files according to the
293 * gospel of sun micro
295 if (type != S_IFREG) {
297 if (type != S_IFBLK && type != S_IFCHR) {
299 } else if (type == S_IFCHR && !(attr->ia_valid & ATTR_SIZE)) {
300 /* If you think you've seen the worst, grok this. */
303 /* Okay, char or block special */
309 /* we've used the SIZE information, so discard it */
310 attr->ia_valid &= ~ATTR_SIZE;
312 /* Make sure the type and device matches */
313 nfserr = nfserr_exist;
314 if (inode && type != (inode->i_mode & S_IFMT))
320 /* File doesn't exist. Create it and set attrs */
321 nfserr = nfsd_create(rqstp, dirfhp, argp->name, argp->len,
322 attr, type, rdev, newfhp);
323 } else if (type == S_IFREG) {
324 dprintk("nfsd: existing %s, valid=%x, size=%ld\n",
325 argp->name, attr->ia_valid, (long) attr->ia_size);
326 /* File already exists. We ignore all attributes except
327 * size, so that creat() behaves exactly like
328 * open(..., O_CREAT|O_TRUNC|O_WRONLY).
330 attr->ia_valid &= ATTR_SIZE;
332 nfserr = nfsd_setattr(rqstp, newfhp, attr, 0, (time_t)0);
336 /* We don't really need to unlock, as fh_put does it. */
341 return nfsd_return_dirop(nfserr, resp);
345 nfsd_proc_remove(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
350 dprintk("nfsd: REMOVE %s %.*s\n", SVCFH_fmt(&argp->fh),
351 argp->len, argp->name);
353 /* Unlink. -SIFDIR means file must not be a directory */
354 nfserr = nfsd_unlink(rqstp, &argp->fh, -S_IFDIR, argp->name, argp->len);
360 nfsd_proc_rename(struct svc_rqst *rqstp, struct nfsd_renameargs *argp,
365 dprintk("nfsd: RENAME %s %.*s -> \n",
366 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname);
367 dprintk("nfsd: -> %s %.*s\n",
368 SVCFH_fmt(&argp->tfh), argp->tlen, argp->tname);
370 nfserr = nfsd_rename(rqstp, &argp->ffh, argp->fname, argp->flen,
371 &argp->tfh, argp->tname, argp->tlen);
378 nfsd_proc_link(struct svc_rqst *rqstp, struct nfsd_linkargs *argp,
383 dprintk("nfsd: LINK %s ->\n",
384 SVCFH_fmt(&argp->ffh));
385 dprintk("nfsd: %s %.*s\n",
386 SVCFH_fmt(&argp->tfh),
390 nfserr = nfsd_link(rqstp, &argp->tfh, argp->tname, argp->tlen,
398 nfsd_proc_symlink(struct svc_rqst *rqstp, struct nfsd_symlinkargs *argp,
404 dprintk("nfsd: SYMLINK %s %.*s -> %.*s\n",
405 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname,
406 argp->tlen, argp->tname);
408 fh_init(&newfh, NFS_FHSIZE);
410 * Create the link, look up new file and set attrs.
412 nfserr = nfsd_symlink(rqstp, &argp->ffh, argp->fname, argp->flen,
413 argp->tname, argp->tlen,
414 &newfh, &argp->attrs);
423 * Make directory. This operation is not idempotent.
424 * N.B. After this call resp->fh needs an fh_put
427 nfsd_proc_mkdir(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
428 struct nfsd_diropres *resp)
432 dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
434 if (resp->fh.fh_dentry) {
436 "nfsd_proc_mkdir: response already verified??\n");
439 argp->attrs.ia_valid &= ~ATTR_SIZE;
440 fh_init(&resp->fh, NFS_FHSIZE);
441 nfserr = nfsd_create(rqstp, &argp->fh, argp->name, argp->len,
442 &argp->attrs, S_IFDIR, 0, &resp->fh);
444 return nfsd_return_dirop(nfserr, resp);
451 nfsd_proc_rmdir(struct svc_rqst *rqstp, struct nfsd_diropargs *argp,
456 dprintk("nfsd: RMDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
458 nfserr = nfsd_unlink(rqstp, &argp->fh, S_IFDIR, argp->name, argp->len);
464 * Read a portion of a directory.
467 nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
468 struct nfsd_readdirres *resp)
474 dprintk("nfsd: READDIR %s %d bytes at %d\n",
475 SVCFH_fmt(&argp->fh),
476 argp->count, argp->cookie);
478 /* Shrink to the client read size */
479 count = (argp->count >> 2) - 2;
481 /* Make sure we've room for the NULL ptr & eof flag */
486 resp->buffer = argp->buffer;
488 resp->buflen = count;
489 resp->common.err = nfs_ok;
490 /* Read directory and encode entries on the fly */
491 offset = argp->cookie;
492 nfserr = nfsd_readdir(rqstp, &argp->fh, &offset,
493 &resp->common, nfssvc_encode_entry);
495 resp->count = resp->buffer - argp->buffer;
497 *resp->offset = htonl(offset);
504 * Get file system info
507 nfsd_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
508 struct nfsd_statfsres *resp)
512 dprintk("nfsd: STATFS %s\n", SVCFH_fmt(&argp->fh));
514 nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats,
515 NFSD_MAY_BYPASS_GSS_ON_ROOT);
521 * NFSv2 Server procedures.
522 * Only the results of non-idempotent operations are cached.
524 struct nfsd_void { int dummy; };
526 #define ST 1 /* status */
527 #define FH 8 /* filehandle */
528 #define AT 18 /* attributes */
530 static struct svc_procedure nfsd_procedures2[18] = {
532 .pc_func = (svc_procfunc) nfsd_proc_null,
533 .pc_decode = (kxdrproc_t) nfssvc_decode_void,
534 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
535 .pc_argsize = sizeof(struct nfsd_void),
536 .pc_ressize = sizeof(struct nfsd_void),
537 .pc_cachetype = RC_NOCACHE,
540 [NFSPROC_GETATTR] = {
541 .pc_func = (svc_procfunc) nfsd_proc_getattr,
542 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle,
543 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
544 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
545 .pc_argsize = sizeof(struct nfsd_fhandle),
546 .pc_ressize = sizeof(struct nfsd_attrstat),
547 .pc_cachetype = RC_NOCACHE,
548 .pc_xdrressize = ST+AT,
550 [NFSPROC_SETATTR] = {
551 .pc_func = (svc_procfunc) nfsd_proc_setattr,
552 .pc_decode = (kxdrproc_t) nfssvc_decode_sattrargs,
553 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
554 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
555 .pc_argsize = sizeof(struct nfsd_sattrargs),
556 .pc_ressize = sizeof(struct nfsd_attrstat),
557 .pc_cachetype = RC_REPLBUFF,
558 .pc_xdrressize = ST+AT,
561 .pc_decode = (kxdrproc_t) nfssvc_decode_void,
562 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
563 .pc_argsize = sizeof(struct nfsd_void),
564 .pc_ressize = sizeof(struct nfsd_void),
565 .pc_cachetype = RC_NOCACHE,
569 .pc_func = (svc_procfunc) nfsd_proc_lookup,
570 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs,
571 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
572 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
573 .pc_argsize = sizeof(struct nfsd_diropargs),
574 .pc_ressize = sizeof(struct nfsd_diropres),
575 .pc_cachetype = RC_NOCACHE,
576 .pc_xdrressize = ST+FH+AT,
578 [NFSPROC_READLINK] = {
579 .pc_func = (svc_procfunc) nfsd_proc_readlink,
580 .pc_decode = (kxdrproc_t) nfssvc_decode_readlinkargs,
581 .pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres,
582 .pc_argsize = sizeof(struct nfsd_readlinkargs),
583 .pc_ressize = sizeof(struct nfsd_readlinkres),
584 .pc_cachetype = RC_NOCACHE,
585 .pc_xdrressize = ST+1+NFS_MAXPATHLEN/4,
588 .pc_func = (svc_procfunc) nfsd_proc_read,
589 .pc_decode = (kxdrproc_t) nfssvc_decode_readargs,
590 .pc_encode = (kxdrproc_t) nfssvc_encode_readres,
591 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
592 .pc_argsize = sizeof(struct nfsd_readargs),
593 .pc_ressize = sizeof(struct nfsd_readres),
594 .pc_cachetype = RC_NOCACHE,
595 .pc_xdrressize = ST+AT+1+NFSSVC_MAXBLKSIZE_V2/4,
597 [NFSPROC_WRITECACHE] = {
598 .pc_decode = (kxdrproc_t) nfssvc_decode_void,
599 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
600 .pc_argsize = sizeof(struct nfsd_void),
601 .pc_ressize = sizeof(struct nfsd_void),
602 .pc_cachetype = RC_NOCACHE,
606 .pc_func = (svc_procfunc) nfsd_proc_write,
607 .pc_decode = (kxdrproc_t) nfssvc_decode_writeargs,
608 .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat,
609 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
610 .pc_argsize = sizeof(struct nfsd_writeargs),
611 .pc_ressize = sizeof(struct nfsd_attrstat),
612 .pc_cachetype = RC_REPLBUFF,
613 .pc_xdrressize = ST+AT,
616 .pc_func = (svc_procfunc) nfsd_proc_create,
617 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs,
618 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
619 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
620 .pc_argsize = sizeof(struct nfsd_createargs),
621 .pc_ressize = sizeof(struct nfsd_diropres),
622 .pc_cachetype = RC_REPLBUFF,
623 .pc_xdrressize = ST+FH+AT,
626 .pc_func = (svc_procfunc) nfsd_proc_remove,
627 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs,
628 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
629 .pc_argsize = sizeof(struct nfsd_diropargs),
630 .pc_ressize = sizeof(struct nfsd_void),
631 .pc_cachetype = RC_REPLSTAT,
635 .pc_func = (svc_procfunc) nfsd_proc_rename,
636 .pc_decode = (kxdrproc_t) nfssvc_decode_renameargs,
637 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
638 .pc_argsize = sizeof(struct nfsd_renameargs),
639 .pc_ressize = sizeof(struct nfsd_void),
640 .pc_cachetype = RC_REPLSTAT,
644 .pc_func = (svc_procfunc) nfsd_proc_link,
645 .pc_decode = (kxdrproc_t) nfssvc_decode_linkargs,
646 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
647 .pc_argsize = sizeof(struct nfsd_linkargs),
648 .pc_ressize = sizeof(struct nfsd_void),
649 .pc_cachetype = RC_REPLSTAT,
652 [NFSPROC_SYMLINK] = {
653 .pc_func = (svc_procfunc) nfsd_proc_symlink,
654 .pc_decode = (kxdrproc_t) nfssvc_decode_symlinkargs,
655 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
656 .pc_argsize = sizeof(struct nfsd_symlinkargs),
657 .pc_ressize = sizeof(struct nfsd_void),
658 .pc_cachetype = RC_REPLSTAT,
662 .pc_func = (svc_procfunc) nfsd_proc_mkdir,
663 .pc_decode = (kxdrproc_t) nfssvc_decode_createargs,
664 .pc_encode = (kxdrproc_t) nfssvc_encode_diropres,
665 .pc_release = (kxdrproc_t) nfssvc_release_fhandle,
666 .pc_argsize = sizeof(struct nfsd_createargs),
667 .pc_ressize = sizeof(struct nfsd_diropres),
668 .pc_cachetype = RC_REPLBUFF,
669 .pc_xdrressize = ST+FH+AT,
672 .pc_func = (svc_procfunc) nfsd_proc_rmdir,
673 .pc_decode = (kxdrproc_t) nfssvc_decode_diropargs,
674 .pc_encode = (kxdrproc_t) nfssvc_encode_void,
675 .pc_argsize = sizeof(struct nfsd_diropargs),
676 .pc_ressize = sizeof(struct nfsd_void),
677 .pc_cachetype = RC_REPLSTAT,
680 [NFSPROC_READDIR] = {
681 .pc_func = (svc_procfunc) nfsd_proc_readdir,
682 .pc_decode = (kxdrproc_t) nfssvc_decode_readdirargs,
683 .pc_encode = (kxdrproc_t) nfssvc_encode_readdirres,
684 .pc_argsize = sizeof(struct nfsd_readdirargs),
685 .pc_ressize = sizeof(struct nfsd_readdirres),
686 .pc_cachetype = RC_NOCACHE,
689 .pc_func = (svc_procfunc) nfsd_proc_statfs,
690 .pc_decode = (kxdrproc_t) nfssvc_decode_fhandle,
691 .pc_encode = (kxdrproc_t) nfssvc_encode_statfsres,
692 .pc_argsize = sizeof(struct nfsd_fhandle),
693 .pc_ressize = sizeof(struct nfsd_statfsres),
694 .pc_cachetype = RC_NOCACHE,
695 .pc_xdrressize = ST+5,
700 struct svc_version nfsd_version2 = {
703 .vs_proc = nfsd_procedures2,
704 .vs_dispatch = nfsd_dispatch,
705 .vs_xdrsize = NFS2_SVC_XDRSIZE,
709 * Map errnos to NFS errnos.
719 { nfserr_perm, -EPERM },
720 { nfserr_noent, -ENOENT },
722 { nfserr_nxio, -ENXIO },
723 { nfserr_acces, -EACCES },
724 { nfserr_exist, -EEXIST },
725 { nfserr_xdev, -EXDEV },
726 { nfserr_mlink, -EMLINK },
727 { nfserr_nodev, -ENODEV },
728 { nfserr_notdir, -ENOTDIR },
729 { nfserr_isdir, -EISDIR },
730 { nfserr_inval, -EINVAL },
731 { nfserr_fbig, -EFBIG },
732 { nfserr_nospc, -ENOSPC },
733 { nfserr_rofs, -EROFS },
734 { nfserr_mlink, -EMLINK },
735 { nfserr_nametoolong, -ENAMETOOLONG },
736 { nfserr_notempty, -ENOTEMPTY },
738 { nfserr_dquot, -EDQUOT },
740 { nfserr_stale, -ESTALE },
741 { nfserr_jukebox, -ETIMEDOUT },
742 { nfserr_jukebox, -ERESTARTSYS },
743 { nfserr_dropit, -EAGAIN },
744 { nfserr_dropit, -ENOMEM },
745 { nfserr_badname, -ESRCH },
746 { nfserr_io, -ETXTBSY },
747 { nfserr_notsupp, -EOPNOTSUPP },
748 { nfserr_toosmall, -ETOOSMALL },
749 { nfserr_serverfault, -ESERVERFAULT },
753 for (i = 0; i < ARRAY_SIZE(nfs_errtbl); i++) {
754 if (nfs_errtbl[i].syserr == errno)
755 return nfs_errtbl[i].nfserr;
757 printk (KERN_INFO "nfsd: non-standard errno: %d\n", errno);