2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2009 Rick Macklem, University of Guelph
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef _NFS_NFSV4ERRSTR_H_
32 #define _NFS_NFSV4ERRSTR_H_
35 * Defines static storage in the C file, but I can't be bothered creating
36 * a library of one function for this, since it is only currently used by
39 static const char *nfsv4_errstr[NFSERR_XATTR2BIG - 10000] = {
41 "Undefined NFSv4 err",
42 "READDIR cookie is stale",
43 "operation not supported",
44 "response limit exceeded",
45 "undefined server error",
46 "type invalid for CREATE",
48 "nverify says attrs same",
51 "I/O failed due to lock",
54 "share reserve denied",
55 "wrong security flavor",
57 "resource exhaustion",
58 "filesystem relocated",
59 "current FH is not set",
60 "minor version not supported",
61 "server has rebooted",
62 "server has rebooted",
63 "state is out of sync",
65 "request is out of seq",
66 "verify - attrs not same",
67 "lock range not supported",
68 "should be file/directory",
69 "no saved filehandle",
70 "some filesystem moved",
71 "recommended attr not sup",
72 "reclaim outside of grace",
73 "reclaim error at server",
74 "conflict on reclaim",
76 "file locks held at CLOSE",
77 "conflict in OPEN and I/O",
78 "owner translation bad",
79 "utf-8 char not supported",
81 "lock range not supported",
82 "no atomic up/downgrade",
83 "undefined operation",
84 "file locking deadlock",
85 "open file blocks op",
86 "lockowner state revoked",
94 "not bound to session",
95 "delegation already wanted",
101 "unknown layout type",
102 "sequence misordered",
106 "reply too big to cache",
107 "retry uncached reply",
109 "too many operations",
110 "operation not in session",
111 "hash algorithm unsupported",
115 "sequence false retry",
118 "encrypt algorithm unsupported",
120 "not only operation",
123 "directory delegation unavailable",
126 "delegation revoked",
127 "partner not supported",
129 "union not supported",
133 "offload no request",
134 "no extended attribute",
135 "extended attribute too big",
139 * Return the error string for the NFS4ERR_xxx. The pointers returned are
140 * static and must not be free'd.
143 nfsv4_geterrstr(int errval)
146 if (errval < NFSERR_BADHANDLE || errval > NFSERR_XATTR2BIG)
148 return (nfsv4_errstr[errval - NFSERR_BADHANDLE]);
151 #endif /* _NFS_NFSV4ERRSTR_H_ */