xref: /linux/include/trace/misc/nfs.h (revision b4db9f840283caca0d904436f187ef56a9126eaa)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Display helpers for NFS protocol elements
4  *
5  * Author: Chuck Lever <chuck.lever@oracle.com>
6  *
7  * Copyright (c) 2020, Oracle and/or its affiliates.
8  */
9 
10 #include <linux/nfs.h>
11 #include <linux/nfs4.h>
12 #include <uapi/linux/nfs.h>
13 
14 TRACE_DEFINE_ENUM(NFS_OK);
15 TRACE_DEFINE_ENUM(NFSERR_PERM);
16 TRACE_DEFINE_ENUM(NFSERR_NOENT);
17 TRACE_DEFINE_ENUM(NFSERR_IO);
18 TRACE_DEFINE_ENUM(NFSERR_NXIO);
19 TRACE_DEFINE_ENUM(NFSERR_EAGAIN);
20 TRACE_DEFINE_ENUM(NFSERR_ACCES);
21 TRACE_DEFINE_ENUM(NFSERR_EXIST);
22 TRACE_DEFINE_ENUM(NFSERR_XDEV);
23 TRACE_DEFINE_ENUM(NFSERR_NODEV);
24 TRACE_DEFINE_ENUM(NFSERR_NOTDIR);
25 TRACE_DEFINE_ENUM(NFSERR_ISDIR);
26 TRACE_DEFINE_ENUM(NFSERR_INVAL);
27 TRACE_DEFINE_ENUM(NFSERR_FBIG);
28 TRACE_DEFINE_ENUM(NFSERR_NOSPC);
29 TRACE_DEFINE_ENUM(NFSERR_ROFS);
30 TRACE_DEFINE_ENUM(NFSERR_MLINK);
31 TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP);
32 TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG);
33 TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY);
34 TRACE_DEFINE_ENUM(NFSERR_DQUOT);
35 TRACE_DEFINE_ENUM(NFSERR_STALE);
36 TRACE_DEFINE_ENUM(NFSERR_REMOTE);
37 TRACE_DEFINE_ENUM(NFSERR_WFLUSH);
38 TRACE_DEFINE_ENUM(NFSERR_BADHANDLE);
39 TRACE_DEFINE_ENUM(NFSERR_NOT_SYNC);
40 TRACE_DEFINE_ENUM(NFSERR_BAD_COOKIE);
41 TRACE_DEFINE_ENUM(NFSERR_NOTSUPP);
42 TRACE_DEFINE_ENUM(NFSERR_TOOSMALL);
43 TRACE_DEFINE_ENUM(NFSERR_SERVERFAULT);
44 TRACE_DEFINE_ENUM(NFSERR_BADTYPE);
45 TRACE_DEFINE_ENUM(NFSERR_JUKEBOX);
46 
47 #define show_nfs_status(x) \
48 	__print_symbolic(x, \
49 		{ NFS_OK,			"OK" }, \
50 		{ NFSERR_PERM,			"PERM" }, \
51 		{ NFSERR_NOENT,			"NOENT" }, \
52 		{ NFSERR_IO,			"IO" }, \
53 		{ NFSERR_NXIO,			"NXIO" }, \
54 		{ ECHILD,			"CHILD" }, \
55 		{ NFSERR_EAGAIN,		"AGAIN" }, \
56 		{ NFSERR_ACCES,			"ACCES" }, \
57 		{ NFSERR_EXIST,			"EXIST" }, \
58 		{ NFSERR_XDEV,			"XDEV" }, \
59 		{ NFSERR_NODEV,			"NODEV" }, \
60 		{ NFSERR_NOTDIR,		"NOTDIR" }, \
61 		{ NFSERR_ISDIR,			"ISDIR" }, \
62 		{ NFSERR_INVAL,			"INVAL" }, \
63 		{ NFSERR_FBIG,			"FBIG" }, \
64 		{ NFSERR_NOSPC,			"NOSPC" }, \
65 		{ NFSERR_ROFS,			"ROFS" }, \
66 		{ NFSERR_MLINK,			"MLINK" }, \
67 		{ NFSERR_OPNOTSUPP,		"OPNOTSUPP" }, \
68 		{ NFSERR_NAMETOOLONG,		"NAMETOOLONG" }, \
69 		{ NFSERR_NOTEMPTY,		"NOTEMPTY" }, \
70 		{ NFSERR_DQUOT,			"DQUOT" }, \
71 		{ NFSERR_STALE,			"STALE" }, \
72 		{ NFSERR_REMOTE,		"REMOTE" }, \
73 		{ NFSERR_WFLUSH,		"WFLUSH" }, \
74 		{ NFSERR_BADHANDLE,		"BADHANDLE" }, \
75 		{ NFSERR_NOT_SYNC,		"NOTSYNC" }, \
76 		{ NFSERR_BAD_COOKIE,		"BADCOOKIE" }, \
77 		{ NFSERR_NOTSUPP,		"NOTSUPP" }, \
78 		{ NFSERR_TOOSMALL,		"TOOSMALL" }, \
79 		{ NFSERR_SERVERFAULT,		"REMOTEIO" }, \
80 		{ NFSERR_BADTYPE,		"BADTYPE" }, \
81 		{ NFSERR_JUKEBOX,		"JUKEBOX" })
82 
83 TRACE_DEFINE_ENUM(NFS_UNSTABLE);
84 TRACE_DEFINE_ENUM(NFS_DATA_SYNC);
85 TRACE_DEFINE_ENUM(NFS_FILE_SYNC);
86 
87 #define show_nfs_stable_how(x) \
88 	__print_symbolic(x, \
89 		{ NFS_UNSTABLE,			"UNSTABLE" }, \
90 		{ NFS_DATA_SYNC,		"DATA_SYNC" }, \
91 		{ NFS_FILE_SYNC,		"FILE_SYNC" })
92 
93 TRACE_DEFINE_ENUM(NFS4_OK);
94 TRACE_DEFINE_ENUM(NFS4ERR_ACCESS);
95 TRACE_DEFINE_ENUM(NFS4ERR_ATTRNOTSUPP);
96 TRACE_DEFINE_ENUM(NFS4ERR_ADMIN_REVOKED);
97 TRACE_DEFINE_ENUM(NFS4ERR_BACK_CHAN_BUSY);
98 TRACE_DEFINE_ENUM(NFS4ERR_BADCHAR);
99 TRACE_DEFINE_ENUM(NFS4ERR_BADHANDLE);
100 TRACE_DEFINE_ENUM(NFS4ERR_BADIOMODE);
101 TRACE_DEFINE_ENUM(NFS4ERR_BADLAYOUT);
102 TRACE_DEFINE_ENUM(NFS4ERR_BADLABEL);
103 TRACE_DEFINE_ENUM(NFS4ERR_BADNAME);
104 TRACE_DEFINE_ENUM(NFS4ERR_BADOWNER);
105 TRACE_DEFINE_ENUM(NFS4ERR_BADSESSION);
106 TRACE_DEFINE_ENUM(NFS4ERR_BADSLOT);
107 TRACE_DEFINE_ENUM(NFS4ERR_BADTYPE);
108 TRACE_DEFINE_ENUM(NFS4ERR_BADXDR);
109 TRACE_DEFINE_ENUM(NFS4ERR_BAD_COOKIE);
110 TRACE_DEFINE_ENUM(NFS4ERR_BAD_HIGH_SLOT);
111 TRACE_DEFINE_ENUM(NFS4ERR_BAD_RANGE);
112 TRACE_DEFINE_ENUM(NFS4ERR_BAD_SEQID);
113 TRACE_DEFINE_ENUM(NFS4ERR_BAD_SESSION_DIGEST);
114 TRACE_DEFINE_ENUM(NFS4ERR_BAD_STATEID);
115 TRACE_DEFINE_ENUM(NFS4ERR_CB_PATH_DOWN);
116 TRACE_DEFINE_ENUM(NFS4ERR_CLID_INUSE);
117 TRACE_DEFINE_ENUM(NFS4ERR_CLIENTID_BUSY);
118 TRACE_DEFINE_ENUM(NFS4ERR_COMPLETE_ALREADY);
119 TRACE_DEFINE_ENUM(NFS4ERR_CONN_NOT_BOUND_TO_SESSION);
120 TRACE_DEFINE_ENUM(NFS4ERR_DEADLOCK);
121 TRACE_DEFINE_ENUM(NFS4ERR_DEADSESSION);
122 TRACE_DEFINE_ENUM(NFS4ERR_DELAY);
123 TRACE_DEFINE_ENUM(NFS4ERR_DELEG_ALREADY_WANTED);
124 TRACE_DEFINE_ENUM(NFS4ERR_DELEG_REVOKED);
125 TRACE_DEFINE_ENUM(NFS4ERR_DENIED);
126 TRACE_DEFINE_ENUM(NFS4ERR_DIRDELEG_UNAVAIL);
127 TRACE_DEFINE_ENUM(NFS4ERR_DQUOT);
128 TRACE_DEFINE_ENUM(NFS4ERR_ENCR_ALG_UNSUPP);
129 TRACE_DEFINE_ENUM(NFS4ERR_EXIST);
130 TRACE_DEFINE_ENUM(NFS4ERR_EXPIRED);
131 TRACE_DEFINE_ENUM(NFS4ERR_FBIG);
132 TRACE_DEFINE_ENUM(NFS4ERR_FHEXPIRED);
133 TRACE_DEFINE_ENUM(NFS4ERR_FILE_OPEN);
134 TRACE_DEFINE_ENUM(NFS4ERR_GRACE);
135 TRACE_DEFINE_ENUM(NFS4ERR_HASH_ALG_UNSUPP);
136 TRACE_DEFINE_ENUM(NFS4ERR_INVAL);
137 TRACE_DEFINE_ENUM(NFS4ERR_IO);
138 TRACE_DEFINE_ENUM(NFS4ERR_ISDIR);
139 TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTTRYLATER);
140 TRACE_DEFINE_ENUM(NFS4ERR_LAYOUTUNAVAILABLE);
141 TRACE_DEFINE_ENUM(NFS4ERR_LEASE_MOVED);
142 TRACE_DEFINE_ENUM(NFS4ERR_LOCKED);
143 TRACE_DEFINE_ENUM(NFS4ERR_LOCKS_HELD);
144 TRACE_DEFINE_ENUM(NFS4ERR_LOCK_RANGE);
145 TRACE_DEFINE_ENUM(NFS4ERR_MINOR_VERS_MISMATCH);
146 TRACE_DEFINE_ENUM(NFS4ERR_MLINK);
147 TRACE_DEFINE_ENUM(NFS4ERR_MOVED);
148 TRACE_DEFINE_ENUM(NFS4ERR_NAMETOOLONG);
149 TRACE_DEFINE_ENUM(NFS4ERR_NOENT);
150 TRACE_DEFINE_ENUM(NFS4ERR_NOFILEHANDLE);
151 TRACE_DEFINE_ENUM(NFS4ERR_NOMATCHING_LAYOUT);
152 TRACE_DEFINE_ENUM(NFS4ERR_NOSPC);
153 TRACE_DEFINE_ENUM(NFS4ERR_NOTDIR);
154 TRACE_DEFINE_ENUM(NFS4ERR_NOTEMPTY);
155 TRACE_DEFINE_ENUM(NFS4ERR_NOTSUPP);
156 TRACE_DEFINE_ENUM(NFS4ERR_NOT_ONLY_OP);
157 TRACE_DEFINE_ENUM(NFS4ERR_NOT_SAME);
158 TRACE_DEFINE_ENUM(NFS4ERR_NO_GRACE);
159 TRACE_DEFINE_ENUM(NFS4ERR_NXIO);
160 TRACE_DEFINE_ENUM(NFS4ERR_OLD_STATEID);
161 TRACE_DEFINE_ENUM(NFS4ERR_OPENMODE);
162 TRACE_DEFINE_ENUM(NFS4ERR_OP_ILLEGAL);
163 TRACE_DEFINE_ENUM(NFS4ERR_OP_NOT_IN_SESSION);
164 TRACE_DEFINE_ENUM(NFS4ERR_PERM);
165 TRACE_DEFINE_ENUM(NFS4ERR_PNFS_IO_HOLE);
166 TRACE_DEFINE_ENUM(NFS4ERR_PNFS_NO_LAYOUT);
167 TRACE_DEFINE_ENUM(NFS4ERR_RECALLCONFLICT);
168 TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_BAD);
169 TRACE_DEFINE_ENUM(NFS4ERR_RECLAIM_CONFLICT);
170 TRACE_DEFINE_ENUM(NFS4ERR_REJECT_DELEG);
171 TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG);
172 TRACE_DEFINE_ENUM(NFS4ERR_REP_TOO_BIG_TO_CACHE);
173 TRACE_DEFINE_ENUM(NFS4ERR_REQ_TOO_BIG);
174 TRACE_DEFINE_ENUM(NFS4ERR_RESOURCE);
175 TRACE_DEFINE_ENUM(NFS4ERR_RESTOREFH);
176 TRACE_DEFINE_ENUM(NFS4ERR_RETRY_UNCACHED_REP);
177 TRACE_DEFINE_ENUM(NFS4ERR_RETURNCONFLICT);
178 TRACE_DEFINE_ENUM(NFS4ERR_ROFS);
179 TRACE_DEFINE_ENUM(NFS4ERR_SAME);
180 TRACE_DEFINE_ENUM(NFS4ERR_SHARE_DENIED);
181 TRACE_DEFINE_ENUM(NFS4ERR_SEQUENCE_POS);
182 TRACE_DEFINE_ENUM(NFS4ERR_SEQ_FALSE_RETRY);
183 TRACE_DEFINE_ENUM(NFS4ERR_SEQ_MISORDERED);
184 TRACE_DEFINE_ENUM(NFS4ERR_SERVERFAULT);
185 TRACE_DEFINE_ENUM(NFS4ERR_STALE);
186 TRACE_DEFINE_ENUM(NFS4ERR_STALE_CLIENTID);
187 TRACE_DEFINE_ENUM(NFS4ERR_STALE_STATEID);
188 TRACE_DEFINE_ENUM(NFS4ERR_SYMLINK);
189 TRACE_DEFINE_ENUM(NFS4ERR_TOOSMALL);
190 TRACE_DEFINE_ENUM(NFS4ERR_TOO_MANY_OPS);
191 TRACE_DEFINE_ENUM(NFS4ERR_UNKNOWN_LAYOUTTYPE);
192 TRACE_DEFINE_ENUM(NFS4ERR_UNSAFE_COMPOUND);
193 TRACE_DEFINE_ENUM(NFS4ERR_WRONGSEC);
194 TRACE_DEFINE_ENUM(NFS4ERR_WRONG_CRED);
195 TRACE_DEFINE_ENUM(NFS4ERR_WRONG_TYPE);
196 TRACE_DEFINE_ENUM(NFS4ERR_XDEV);
197 
198 TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_MDS);
199 TRACE_DEFINE_ENUM(NFS4ERR_RESET_TO_PNFS);
200 
201 #define show_nfs4_status(x) \
202 	__print_symbolic(x, \
203 		{ NFS4_OK,			"OK" }, \
204 		{ EPERM,			"EPERM" }, \
205 		{ ENOENT,			"ENOENT" }, \
206 		{ EIO,				"EIO" }, \
207 		{ ENXIO,			"ENXIO" }, \
208 		{ EACCES,			"EACCES" }, \
209 		{ EEXIST,			"EEXIST" }, \
210 		{ EXDEV,			"EXDEV" }, \
211 		{ ENOTDIR,			"ENOTDIR" }, \
212 		{ EISDIR,			"EISDIR" }, \
213 		{ EFBIG,			"EFBIG" }, \
214 		{ ENOSPC,			"ENOSPC" }, \
215 		{ EROFS,			"EROFS" }, \
216 		{ EMLINK,			"EMLINK" }, \
217 		{ ENAMETOOLONG,			"ENAMETOOLONG" }, \
218 		{ ENOTEMPTY,			"ENOTEMPTY" }, \
219 		{ EDQUOT,			"EDQUOT" }, \
220 		{ ESTALE,			"ESTALE" }, \
221 		{ EBADHANDLE,			"EBADHANDLE" }, \
222 		{ EBADCOOKIE,			"EBADCOOKIE" }, \
223 		{ ENOTSUPP,			"ENOTSUPP" }, \
224 		{ ETOOSMALL,			"ETOOSMALL" }, \
225 		{ EREMOTEIO,			"EREMOTEIO" }, \
226 		{ EBADTYPE,			"EBADTYPE" }, \
227 		{ EAGAIN,			"EAGAIN" }, \
228 		{ ELOOP,			"ELOOP" }, \
229 		{ EOPNOTSUPP,			"EOPNOTSUPP" }, \
230 		{ EDEADLK,			"EDEADLK" }, \
231 		{ ENOMEM,			"ENOMEM" }, \
232 		{ EKEYEXPIRED,			"EKEYEXPIRED" }, \
233 		{ ETIMEDOUT,			"ETIMEDOUT" }, \
234 		{ ERESTARTSYS,			"ERESTARTSYS" }, \
235 		{ ECONNREFUSED,			"ECONNREFUSED" }, \
236 		{ ECONNRESET,			"ECONNRESET" }, \
237 		{ ENETUNREACH,			"ENETUNREACH" }, \
238 		{ EHOSTUNREACH,			"EHOSTUNREACH" }, \
239 		{ EHOSTDOWN,			"EHOSTDOWN" }, \
240 		{ EPIPE,			"EPIPE" }, \
241 		{ EPFNOSUPPORT,			"EPFNOSUPPORT" }, \
242 		{ EINVAL,			"EINVAL" }, \
243 		{ EPROTONOSUPPORT,		"EPROTONOSUPPORT" }, \
244 		{ NFS4ERR_ACCESS,		"ACCESS" }, \
245 		{ NFS4ERR_ATTRNOTSUPP,		"ATTRNOTSUPP" }, \
246 		{ NFS4ERR_ADMIN_REVOKED,	"ADMIN_REVOKED" }, \
247 		{ NFS4ERR_BACK_CHAN_BUSY,	"BACK_CHAN_BUSY" }, \
248 		{ NFS4ERR_BADCHAR,		"BADCHAR" }, \
249 		{ NFS4ERR_BADHANDLE,		"BADHANDLE" }, \
250 		{ NFS4ERR_BADIOMODE,		"BADIOMODE" }, \
251 		{ NFS4ERR_BADLAYOUT,		"BADLAYOUT" }, \
252 		{ NFS4ERR_BADLABEL,		"BADLABEL" }, \
253 		{ NFS4ERR_BADNAME,		"BADNAME" }, \
254 		{ NFS4ERR_BADOWNER,		"BADOWNER" }, \
255 		{ NFS4ERR_BADSESSION,		"BADSESSION" }, \
256 		{ NFS4ERR_BADSLOT,		"BADSLOT" }, \
257 		{ NFS4ERR_BADTYPE,		"BADTYPE" }, \
258 		{ NFS4ERR_BADXDR,		"BADXDR" }, \
259 		{ NFS4ERR_BAD_COOKIE,		"BAD_COOKIE" }, \
260 		{ NFS4ERR_BAD_HIGH_SLOT,	"BAD_HIGH_SLOT" }, \
261 		{ NFS4ERR_BAD_RANGE,		"BAD_RANGE" }, \
262 		{ NFS4ERR_BAD_SEQID,		"BAD_SEQID" }, \
263 		{ NFS4ERR_BAD_SESSION_DIGEST,	"BAD_SESSION_DIGEST" }, \
264 		{ NFS4ERR_BAD_STATEID,		"BAD_STATEID" }, \
265 		{ NFS4ERR_CB_PATH_DOWN,		"CB_PATH_DOWN" }, \
266 		{ NFS4ERR_CLID_INUSE,		"CLID_INUSE" }, \
267 		{ NFS4ERR_CLIENTID_BUSY,	"CLIENTID_BUSY" }, \
268 		{ NFS4ERR_COMPLETE_ALREADY,	"COMPLETE_ALREADY" }, \
269 		{ NFS4ERR_CONN_NOT_BOUND_TO_SESSION, "CONN_NOT_BOUND_TO_SESSION" }, \
270 		{ NFS4ERR_DEADLOCK,		"DEADLOCK" }, \
271 		{ NFS4ERR_DEADSESSION,		"DEAD_SESSION" }, \
272 		{ NFS4ERR_DELAY,		"DELAY" }, \
273 		{ NFS4ERR_DELEG_ALREADY_WANTED,	"DELEG_ALREADY_WANTED" }, \
274 		{ NFS4ERR_DELEG_REVOKED,	"DELEG_REVOKED" }, \
275 		{ NFS4ERR_DENIED,		"DENIED" }, \
276 		{ NFS4ERR_DIRDELEG_UNAVAIL,	"DIRDELEG_UNAVAIL" }, \
277 		{ NFS4ERR_DQUOT,		"DQUOT" }, \
278 		{ NFS4ERR_ENCR_ALG_UNSUPP,	"ENCR_ALG_UNSUPP" }, \
279 		{ NFS4ERR_EXIST,		"EXIST" }, \
280 		{ NFS4ERR_EXPIRED,		"EXPIRED" }, \
281 		{ NFS4ERR_FBIG,			"FBIG" }, \
282 		{ NFS4ERR_FHEXPIRED,		"FHEXPIRED" }, \
283 		{ NFS4ERR_FILE_OPEN,		"FILE_OPEN" }, \
284 		{ NFS4ERR_GRACE,		"GRACE" }, \
285 		{ NFS4ERR_HASH_ALG_UNSUPP,	"HASH_ALG_UNSUPP" }, \
286 		{ NFS4ERR_INVAL,		"INVAL" }, \
287 		{ NFS4ERR_IO,			"IO" }, \
288 		{ NFS4ERR_ISDIR,		"ISDIR" }, \
289 		{ NFS4ERR_LAYOUTTRYLATER,	"LAYOUTTRYLATER" }, \
290 		{ NFS4ERR_LAYOUTUNAVAILABLE,	"LAYOUTUNAVAILABLE" }, \
291 		{ NFS4ERR_LEASE_MOVED,		"LEASE_MOVED" }, \
292 		{ NFS4ERR_LOCKED,		"LOCKED" }, \
293 		{ NFS4ERR_LOCKS_HELD,		"LOCKS_HELD" }, \
294 		{ NFS4ERR_LOCK_RANGE,		"LOCK_RANGE" }, \
295 		{ NFS4ERR_MINOR_VERS_MISMATCH,	"MINOR_VERS_MISMATCH" }, \
296 		{ NFS4ERR_MLINK,		"MLINK" }, \
297 		{ NFS4ERR_MOVED,		"MOVED" }, \
298 		{ NFS4ERR_NAMETOOLONG,		"NAMETOOLONG" }, \
299 		{ NFS4ERR_NOENT,		"NOENT" }, \
300 		{ NFS4ERR_NOFILEHANDLE,		"NOFILEHANDLE" }, \
301 		{ NFS4ERR_NOMATCHING_LAYOUT,	"NOMATCHING_LAYOUT" }, \
302 		{ NFS4ERR_NOSPC,		"NOSPC" }, \
303 		{ NFS4ERR_NOTDIR,		"NOTDIR" }, \
304 		{ NFS4ERR_NOTEMPTY,		"NOTEMPTY" }, \
305 		{ NFS4ERR_NOTSUPP,		"NOTSUPP" }, \
306 		{ NFS4ERR_NOT_ONLY_OP,		"NOT_ONLY_OP" }, \
307 		{ NFS4ERR_NOT_SAME,		"NOT_SAME" }, \
308 		{ NFS4ERR_NO_GRACE,		"NO_GRACE" }, \
309 		{ NFS4ERR_NXIO,			"NXIO" }, \
310 		{ NFS4ERR_OLD_STATEID,		"OLD_STATEID" }, \
311 		{ NFS4ERR_OPENMODE,		"OPENMODE" }, \
312 		{ NFS4ERR_OP_ILLEGAL,		"OP_ILLEGAL" }, \
313 		{ NFS4ERR_OP_NOT_IN_SESSION,	"OP_NOT_IN_SESSION" }, \
314 		{ NFS4ERR_PERM,			"PERM" }, \
315 		{ NFS4ERR_PNFS_IO_HOLE,		"PNFS_IO_HOLE" }, \
316 		{ NFS4ERR_PNFS_NO_LAYOUT,	"PNFS_NO_LAYOUT" }, \
317 		{ NFS4ERR_RECALLCONFLICT,	"RECALLCONFLICT" }, \
318 		{ NFS4ERR_RECLAIM_BAD,		"RECLAIM_BAD" }, \
319 		{ NFS4ERR_RECLAIM_CONFLICT,	"RECLAIM_CONFLICT" }, \
320 		{ NFS4ERR_REJECT_DELEG,		"REJECT_DELEG" }, \
321 		{ NFS4ERR_REP_TOO_BIG,		"REP_TOO_BIG" }, \
322 		{ NFS4ERR_REP_TOO_BIG_TO_CACHE,	"REP_TOO_BIG_TO_CACHE" }, \
323 		{ NFS4ERR_REQ_TOO_BIG,		"REQ_TOO_BIG" }, \
324 		{ NFS4ERR_RESOURCE,		"RESOURCE" }, \
325 		{ NFS4ERR_RESTOREFH,		"RESTOREFH" }, \
326 		{ NFS4ERR_RETRY_UNCACHED_REP,	"RETRY_UNCACHED_REP" }, \
327 		{ NFS4ERR_RETURNCONFLICT,	"RETURNCONFLICT" }, \
328 		{ NFS4ERR_ROFS,			"ROFS" }, \
329 		{ NFS4ERR_SAME,			"SAME" }, \
330 		{ NFS4ERR_SHARE_DENIED,		"SHARE_DENIED" }, \
331 		{ NFS4ERR_SEQUENCE_POS,		"SEQUENCE_POS" }, \
332 		{ NFS4ERR_SEQ_FALSE_RETRY,	"SEQ_FALSE_RETRY" }, \
333 		{ NFS4ERR_SEQ_MISORDERED,	"SEQ_MISORDERED" }, \
334 		{ NFS4ERR_SERVERFAULT,		"SERVERFAULT" }, \
335 		{ NFS4ERR_STALE,		"STALE" }, \
336 		{ NFS4ERR_STALE_CLIENTID,	"STALE_CLIENTID" }, \
337 		{ NFS4ERR_STALE_STATEID,	"STALE_STATEID" }, \
338 		{ NFS4ERR_SYMLINK,		"SYMLINK" }, \
339 		{ NFS4ERR_TOOSMALL,		"TOOSMALL" }, \
340 		{ NFS4ERR_TOO_MANY_OPS,		"TOO_MANY_OPS" }, \
341 		{ NFS4ERR_UNKNOWN_LAYOUTTYPE,	"UNKNOWN_LAYOUTTYPE" }, \
342 		{ NFS4ERR_UNSAFE_COMPOUND,	"UNSAFE_COMPOUND" }, \
343 		{ NFS4ERR_WRONGSEC,		"WRONGSEC" }, \
344 		{ NFS4ERR_WRONG_CRED,		"WRONG_CRED" }, \
345 		{ NFS4ERR_WRONG_TYPE,		"WRONG_TYPE" }, \
346 		{ NFS4ERR_XDEV,			"XDEV" }, \
347 		/* ***** Internal to Linux NFS client ***** */ \
348 		{ NFS4ERR_RESET_TO_MDS,		"RESET_TO_MDS" }, \
349 		{ NFS4ERR_RESET_TO_PNFS,	"RESET_TO_PNFS" })
350 
351 #define show_nfs4_verifier(x) \
352 	__print_hex_str(x, NFS4_VERIFIER_SIZE)
353 
354 TRACE_DEFINE_ENUM(IOMODE_READ);
355 TRACE_DEFINE_ENUM(IOMODE_RW);
356 TRACE_DEFINE_ENUM(IOMODE_ANY);
357 
358 #define show_pnfs_layout_iomode(x) \
359 	__print_symbolic(x, \
360 		{ IOMODE_READ,			"READ" }, \
361 		{ IOMODE_RW,			"RW" }, \
362 		{ IOMODE_ANY,			"ANY" })
363 
364 #define show_rca_mask(x) \
365 	__print_flags(x, "|", \
366 		{ BIT(RCA4_TYPE_MASK_RDATA_DLG),	"RDATA_DLG" }, \
367 		{ BIT(RCA4_TYPE_MASK_WDATA_DLG),	"WDATA_DLG" }, \
368 		{ BIT(RCA4_TYPE_MASK_DIR_DLG),		"DIR_DLG" }, \
369 		{ BIT(RCA4_TYPE_MASK_FILE_LAYOUT),	"FILE_LAYOUT" }, \
370 		{ BIT(RCA4_TYPE_MASK_BLK_LAYOUT),	"BLK_LAYOUT" }, \
371 		{ BIT(RCA4_TYPE_MASK_OBJ_LAYOUT_MIN),	"OBJ_LAYOUT_MIN" }, \
372 		{ BIT(RCA4_TYPE_MASK_OBJ_LAYOUT_MAX),	"OBJ_LAYOUT_MAX" }, \
373 		{ BIT(RCA4_TYPE_MASK_OTHER_LAYOUT_MIN),	"OTHER_LAYOUT_MIN" }, \
374 		{ BIT(RCA4_TYPE_MASK_OTHER_LAYOUT_MAX),	"OTHER_LAYOUT_MAX" })
375 
376 #define show_nfs4_seq4_status(x) \
377 	__print_flags(x, "|", \
378 		{ SEQ4_STATUS_CB_PATH_DOWN,		"CB_PATH_DOWN" }, \
379 		{ SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING,	"CB_GSS_CONTEXTS_EXPIRING" }, \
380 		{ SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED,	"CB_GSS_CONTEXTS_EXPIRED" }, \
381 		{ SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, "EXPIRED_ALL_STATE_REVOKED" }, \
382 		{ SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, "EXPIRED_SOME_STATE_REVOKED" }, \
383 		{ SEQ4_STATUS_ADMIN_STATE_REVOKED,	"ADMIN_STATE_REVOKED" }, \
384 		{ SEQ4_STATUS_RECALLABLE_STATE_REVOKED,	"RECALLABLE_STATE_REVOKED" }, \
385 		{ SEQ4_STATUS_LEASE_MOVED,		"LEASE_MOVED" }, \
386 		{ SEQ4_STATUS_RESTART_RECLAIM_NEEDED,	"RESTART_RECLAIM_NEEDED" }, \
387 		{ SEQ4_STATUS_CB_PATH_DOWN_SESSION,	"CB_PATH_DOWN_SESSION" }, \
388 		{ SEQ4_STATUS_BACKCHANNEL_FAULT,	"BACKCHANNEL_FAULT" })
389 
390 TRACE_DEFINE_ENUM(OP_CB_GETATTR);
391 TRACE_DEFINE_ENUM(OP_CB_RECALL);
392 TRACE_DEFINE_ENUM(OP_CB_LAYOUTRECALL);
393 TRACE_DEFINE_ENUM(OP_CB_NOTIFY);
394 TRACE_DEFINE_ENUM(OP_CB_PUSH_DELEG);
395 TRACE_DEFINE_ENUM(OP_CB_RECALL_ANY);
396 TRACE_DEFINE_ENUM(OP_CB_RECALLABLE_OBJ_AVAIL);
397 TRACE_DEFINE_ENUM(OP_CB_RECALL_SLOT);
398 TRACE_DEFINE_ENUM(OP_CB_SEQUENCE);
399 TRACE_DEFINE_ENUM(OP_CB_WANTS_CANCELLED);
400 TRACE_DEFINE_ENUM(OP_CB_NOTIFY_LOCK);
401 TRACE_DEFINE_ENUM(OP_CB_NOTIFY_DEVICEID);
402 TRACE_DEFINE_ENUM(OP_CB_OFFLOAD);
403 TRACE_DEFINE_ENUM(OP_CB_ILLEGAL);
404 
405 #define show_nfs4_cb_op(x) \
406 	__print_symbolic(x, \
407 		{ 0,				"CB_NULL" }, \
408 		{ 1,				"CB_COMPOUND" }, \
409 		{ OP_CB_GETATTR,		"CB_GETATTR" }, \
410 		{ OP_CB_RECALL,			"CB_RECALL" }, \
411 		{ OP_CB_LAYOUTRECALL,		"CB_LAYOUTRECALL" }, \
412 		{ OP_CB_NOTIFY,			"CB_NOTIFY" }, \
413 		{ OP_CB_PUSH_DELEG,		"CB_PUSH_DELEG" }, \
414 		{ OP_CB_RECALL_ANY,		"CB_RECALL_ANY" }, \
415 		{ OP_CB_RECALLABLE_OBJ_AVAIL,	"CB_RECALLABLE_OBJ_AVAIL" }, \
416 		{ OP_CB_RECALL_SLOT,		"CB_RECALL_SLOT" }, \
417 		{ OP_CB_SEQUENCE,		"CB_SEQUENCE" }, \
418 		{ OP_CB_WANTS_CANCELLED,	"CB_WANTS_CANCELLED" }, \
419 		{ OP_CB_NOTIFY_LOCK,		"CB_NOTIFY_LOCK" }, \
420 		{ OP_CB_NOTIFY_DEVICEID,	"CB_NOTIFY_DEVICEID" }, \
421 		{ OP_CB_OFFLOAD,		"CB_OFFLOAD" }, \
422 		{ OP_CB_ILLEGAL,		"CB_ILLEGAL" })
423