xref: /netbsd-src/sys/fs/nfs/common/nfsv4_errstr.h (revision 6ca35587140cd9a0531fe714770d4b88eeec3317)
1*6ca35587Sdholland /*	$NetBSD: nfsv4_errstr.h,v 1.1.1.1 2013/09/30 07:19:42 dholland Exp $	*/
2*6ca35587Sdholland /*-
3*6ca35587Sdholland  * Copyright (c) 2009 Rick Macklem, University of Guelph
4*6ca35587Sdholland  * All rights reserved.
5*6ca35587Sdholland  *
6*6ca35587Sdholland  * Redistribution and use in source and binary forms, with or without
7*6ca35587Sdholland  * modification, are permitted provided that the following conditions
8*6ca35587Sdholland  * are met:
9*6ca35587Sdholland  * 1. Redistributions of source code must retain the above copyright
10*6ca35587Sdholland  *    notice, this list of conditions and the following disclaimer.
11*6ca35587Sdholland  * 2. Redistributions in binary form must reproduce the above copyright
12*6ca35587Sdholland  *    notice, this list of conditions and the following disclaimer in the
13*6ca35587Sdholland  *    documentation and/or other materials provided with the distribution.
14*6ca35587Sdholland  *
15*6ca35587Sdholland  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*6ca35587Sdholland  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*6ca35587Sdholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*6ca35587Sdholland  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*6ca35587Sdholland  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*6ca35587Sdholland  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*6ca35587Sdholland  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*6ca35587Sdholland  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*6ca35587Sdholland  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*6ca35587Sdholland  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*6ca35587Sdholland  * SUCH DAMAGE.
26*6ca35587Sdholland  *
27*6ca35587Sdholland  * FreeBSD: head/sys/fs/nfs/nfsv4_errstr.h 191783 2009-05-04 15:23:58Z rmacklem
28*6ca35587Sdholland  * $NetBSD: nfsv4_errstr.h,v 1.1.1.1 2013/09/30 07:19:42 dholland Exp $
29*6ca35587Sdholland  */
30*6ca35587Sdholland 
31*6ca35587Sdholland #ifndef _NFS_NFSV4ERRSTR_H_
32*6ca35587Sdholland #define	_NFS_NFSV4ERRSTR_H_
33*6ca35587Sdholland 
34*6ca35587Sdholland /*
35*6ca35587Sdholland  * Defines static storage in the C file, but I can't be bothered creating
36*6ca35587Sdholland  * a library of one function for this, since it is only currently used by
37*6ca35587Sdholland  * mount_newnfs.c.
38*6ca35587Sdholland  */
39*6ca35587Sdholland static const char *nfsv4_errstr[48] = {
40*6ca35587Sdholland 	"Illegal filehandle",
41*6ca35587Sdholland 	"Undefined NFSv4 err",
42*6ca35587Sdholland 	"READDIR cookie is stale",
43*6ca35587Sdholland 	"operation not supported",
44*6ca35587Sdholland 	"response limit exceeded",
45*6ca35587Sdholland 	"undefined server error",
46*6ca35587Sdholland 	"type invalid for CREATE",
47*6ca35587Sdholland 	"file busy - retry",
48*6ca35587Sdholland 	"nverify says attrs same",
49*6ca35587Sdholland 	"lock unavailable",
50*6ca35587Sdholland 	"lock lease expired",
51*6ca35587Sdholland 	"I/O failed due to lock",
52*6ca35587Sdholland 	"in grace period",
53*6ca35587Sdholland 	"filehandle expired",
54*6ca35587Sdholland 	"share reserve denied",
55*6ca35587Sdholland 	"wrong security flavor",
56*6ca35587Sdholland 	"clientid in use",
57*6ca35587Sdholland 	"resource exhaustion",
58*6ca35587Sdholland 	"filesystem relocated",
59*6ca35587Sdholland 	"current FH is not set",
60*6ca35587Sdholland 	"minor vers not supp",
61*6ca35587Sdholland 	"server has rebooted",
62*6ca35587Sdholland 	"server has rebooted",
63*6ca35587Sdholland 	"state is out of sync",
64*6ca35587Sdholland 	"incorrect stateid",
65*6ca35587Sdholland 	"request is out of seq",
66*6ca35587Sdholland 	"verify - attrs not same",
67*6ca35587Sdholland 	"lock range not supported",
68*6ca35587Sdholland 	"should be file/directory",
69*6ca35587Sdholland 	"no saved filehandle",
70*6ca35587Sdholland 	"some filesystem moved",
71*6ca35587Sdholland 	"recommended attr not sup",
72*6ca35587Sdholland 	"reclaim outside of grace",
73*6ca35587Sdholland 	"reclaim error at server",
74*6ca35587Sdholland 	"conflict on reclaim",
75*6ca35587Sdholland 	"XDR decode failed",
76*6ca35587Sdholland 	"file locks held at CLOSE",
77*6ca35587Sdholland 	"conflict in OPEN and I/O",
78*6ca35587Sdholland 	"owner translation bad",
79*6ca35587Sdholland 	"utf-8 char not supported",
80*6ca35587Sdholland 	"name not supported",
81*6ca35587Sdholland 	"lock range not supported",
82*6ca35587Sdholland 	"no atomic up/downgrade",
83*6ca35587Sdholland 	"undefined operation",
84*6ca35587Sdholland 	"file locking deadlock",
85*6ca35587Sdholland 	"open file blocks op",
86*6ca35587Sdholland 	"lockowner state revoked",
87*6ca35587Sdholland 	"callback path down"
88*6ca35587Sdholland };
89*6ca35587Sdholland 
90*6ca35587Sdholland /*
91*6ca35587Sdholland  * Return the error string for the NFS4ERR_xxx. The pointers returned are
92*6ca35587Sdholland  * static and must not be free'd.
93*6ca35587Sdholland  */
94*6ca35587Sdholland static const char *
nfsv4_geterrstr(int errval)95*6ca35587Sdholland nfsv4_geterrstr(int errval)
96*6ca35587Sdholland {
97*6ca35587Sdholland 
98*6ca35587Sdholland 	if (errval < NFSERR_BADHANDLE || errval > NFSERR_CBPATHDOWN)
99*6ca35587Sdholland 		return (NULL);
100*6ca35587Sdholland 	return (nfsv4_errstr[errval - NFSERR_BADHANDLE]);
101*6ca35587Sdholland }
102*6ca35587Sdholland 
103*6ca35587Sdholland #endif	/* _NFS_NFSV4ERRSTR_H_ */
104