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 		{ EPROTONOSUPPORT,		"EPROTONOSUPPORT" }, \
243 		{ NFS4ERR_ACCESS,		"ACCESS" }, \
244 		{ NFS4ERR_ATTRNOTSUPP,		"ATTRNOTSUPP" }, \
245 		{ NFS4ERR_ADMIN_REVOKED,	"ADMIN_REVOKED" }, \
246 		{ NFS4ERR_BACK_CHAN_BUSY,	"BACK_CHAN_BUSY" }, \
247 		{ NFS4ERR_BADCHAR,		"BADCHAR" }, \
248 		{ NFS4ERR_BADHANDLE,		"BADHANDLE" }, \
249 		{ NFS4ERR_BADIOMODE,		"BADIOMODE" }, \
250 		{ NFS4ERR_BADLAYOUT,		"BADLAYOUT" }, \
251 		{ NFS4ERR_BADLABEL,		"BADLABEL" }, \
252 		{ NFS4ERR_BADNAME,		"BADNAME" }, \
253 		{ NFS4ERR_BADOWNER,		"BADOWNER" }, \
254 		{ NFS4ERR_BADSESSION,		"BADSESSION" }, \
255 		{ NFS4ERR_BADSLOT,		"BADSLOT" }, \
256 		{ NFS4ERR_BADTYPE,		"BADTYPE" }, \
257 		{ NFS4ERR_BADXDR,		"BADXDR" }, \
258 		{ NFS4ERR_BAD_COOKIE,		"BAD_COOKIE" }, \
259 		{ NFS4ERR_BAD_HIGH_SLOT,	"BAD_HIGH_SLOT" }, \
260 		{ NFS4ERR_BAD_RANGE,		"BAD_RANGE" }, \
261 		{ NFS4ERR_BAD_SEQID,		"BAD_SEQID" }, \
262 		{ NFS4ERR_BAD_SESSION_DIGEST,	"BAD_SESSION_DIGEST" }, \
263 		{ NFS4ERR_BAD_STATEID,		"BAD_STATEID" }, \
264 		{ NFS4ERR_CB_PATH_DOWN,		"CB_PATH_DOWN" }, \
265 		{ NFS4ERR_CLID_INUSE,		"CLID_INUSE" }, \
266 		{ NFS4ERR_CLIENTID_BUSY,	"CLIENTID_BUSY" }, \
267 		{ NFS4ERR_COMPLETE_ALREADY,	"COMPLETE_ALREADY" }, \
268 		{ NFS4ERR_CONN_NOT_BOUND_TO_SESSION, "CONN_NOT_BOUND_TO_SESSION" }, \
269 		{ NFS4ERR_DEADLOCK,		"DEADLOCK" }, \
270 		{ NFS4ERR_DEADSESSION,		"DEAD_SESSION" }, \
271 		{ NFS4ERR_DELAY,		"DELAY" }, \
272 		{ NFS4ERR_DELEG_ALREADY_WANTED,	"DELEG_ALREADY_WANTED" }, \
273 		{ NFS4ERR_DELEG_REVOKED,	"DELEG_REVOKED" }, \
274 		{ NFS4ERR_DENIED,		"DENIED" }, \
275 		{ NFS4ERR_DIRDELEG_UNAVAIL,	"DIRDELEG_UNAVAIL" }, \
276 		{ NFS4ERR_DQUOT,		"DQUOT" }, \
277 		{ NFS4ERR_ENCR_ALG_UNSUPP,	"ENCR_ALG_UNSUPP" }, \
278 		{ NFS4ERR_EXIST,		"EXIST" }, \
279 		{ NFS4ERR_EXPIRED,		"EXPIRED" }, \
280 		{ NFS4ERR_FBIG,			"FBIG" }, \
281 		{ NFS4ERR_FHEXPIRED,		"FHEXPIRED" }, \
282 		{ NFS4ERR_FILE_OPEN,		"FILE_OPEN" }, \
283 		{ NFS4ERR_GRACE,		"GRACE" }, \
284 		{ NFS4ERR_HASH_ALG_UNSUPP,	"HASH_ALG_UNSUPP" }, \
285 		{ NFS4ERR_INVAL,		"INVAL" }, \
286 		{ NFS4ERR_IO,			"IO" }, \
287 		{ NFS4ERR_ISDIR,		"ISDIR" }, \
288 		{ NFS4ERR_LAYOUTTRYLATER,	"LAYOUTTRYLATER" }, \
289 		{ NFS4ERR_LAYOUTUNAVAILABLE,	"LAYOUTUNAVAILABLE" }, \
290 		{ NFS4ERR_LEASE_MOVED,		"LEASE_MOVED" }, \
291 		{ NFS4ERR_LOCKED,		"LOCKED" }, \
292 		{ NFS4ERR_LOCKS_HELD,		"LOCKS_HELD" }, \
293 		{ NFS4ERR_LOCK_RANGE,		"LOCK_RANGE" }, \
294 		{ NFS4ERR_MINOR_VERS_MISMATCH,	"MINOR_VERS_MISMATCH" }, \
295 		{ NFS4ERR_MLINK,		"MLINK" }, \
296 		{ NFS4ERR_MOVED,		"MOVED" }, \
297 		{ NFS4ERR_NAMETOOLONG,		"NAMETOOLONG" }, \
298 		{ NFS4ERR_NOENT,		"NOENT" }, \
299 		{ NFS4ERR_NOFILEHANDLE,		"NOFILEHANDLE" }, \
300 		{ NFS4ERR_NOMATCHING_LAYOUT,	"NOMATCHING_LAYOUT" }, \
301 		{ NFS4ERR_NOSPC,		"NOSPC" }, \
302 		{ NFS4ERR_NOTDIR,		"NOTDIR" }, \
303 		{ NFS4ERR_NOTEMPTY,		"NOTEMPTY" }, \
304 		{ NFS4ERR_NOTSUPP,		"NOTSUPP" }, \
305 		{ NFS4ERR_NOT_ONLY_OP,		"NOT_ONLY_OP" }, \
306 		{ NFS4ERR_NOT_SAME,		"NOT_SAME" }, \
307 		{ NFS4ERR_NO_GRACE,		"NO_GRACE" }, \
308 		{ NFS4ERR_NXIO,			"NXIO" }, \
309 		{ NFS4ERR_OLD_STATEID,		"OLD_STATEID" }, \
310 		{ NFS4ERR_OPENMODE,		"OPENMODE" }, \
311 		{ NFS4ERR_OP_ILLEGAL,		"OP_ILLEGAL" }, \
312 		{ NFS4ERR_OP_NOT_IN_SESSION,	"OP_NOT_IN_SESSION" }, \
313 		{ NFS4ERR_PERM,			"PERM" }, \
314 		{ NFS4ERR_PNFS_IO_HOLE,		"PNFS_IO_HOLE" }, \
315 		{ NFS4ERR_PNFS_NO_LAYOUT,	"PNFS_NO_LAYOUT" }, \
316 		{ NFS4ERR_RECALLCONFLICT,	"RECALLCONFLICT" }, \
317 		{ NFS4ERR_RECLAIM_BAD,		"RECLAIM_BAD" }, \
318 		{ NFS4ERR_RECLAIM_CONFLICT,	"RECLAIM_CONFLICT" }, \
319 		{ NFS4ERR_REJECT_DELEG,		"REJECT_DELEG" }, \
320 		{ NFS4ERR_REP_TOO_BIG,		"REP_TOO_BIG" }, \
321 		{ NFS4ERR_REP_TOO_BIG_TO_CACHE,	"REP_TOO_BIG_TO_CACHE" }, \
322 		{ NFS4ERR_REQ_TOO_BIG,		"REQ_TOO_BIG" }, \
323 		{ NFS4ERR_RESOURCE,		"RESOURCE" }, \
324 		{ NFS4ERR_RESTOREFH,		"RESTOREFH" }, \
325 		{ NFS4ERR_RETRY_UNCACHED_REP,	"RETRY_UNCACHED_REP" }, \
326 		{ NFS4ERR_RETURNCONFLICT,	"RETURNCONFLICT" }, \
327 		{ NFS4ERR_ROFS,			"ROFS" }, \
328 		{ NFS4ERR_SAME,			"SAME" }, \
329 		{ NFS4ERR_SHARE_DENIED,		"SHARE_DENIED" }, \
330 		{ NFS4ERR_SEQUENCE_POS,		"SEQUENCE_POS" }, \
331 		{ NFS4ERR_SEQ_FALSE_RETRY,	"SEQ_FALSE_RETRY" }, \
332 		{ NFS4ERR_SEQ_MISORDERED,	"SEQ_MISORDERED" }, \
333 		{ NFS4ERR_SERVERFAULT,		"SERVERFAULT" }, \
334 		{ NFS4ERR_STALE,		"STALE" }, \
335 		{ NFS4ERR_STALE_CLIENTID,	"STALE_CLIENTID" }, \
336 		{ NFS4ERR_STALE_STATEID,	"STALE_STATEID" }, \
337 		{ NFS4ERR_SYMLINK,		"SYMLINK" }, \
338 		{ NFS4ERR_TOOSMALL,		"TOOSMALL" }, \
339 		{ NFS4ERR_TOO_MANY_OPS,		"TOO_MANY_OPS" }, \
340 		{ NFS4ERR_UNKNOWN_LAYOUTTYPE,	"UNKNOWN_LAYOUTTYPE" }, \
341 		{ NFS4ERR_UNSAFE_COMPOUND,	"UNSAFE_COMPOUND" }, \
342 		{ NFS4ERR_WRONGSEC,		"WRONGSEC" }, \
343 		{ NFS4ERR_WRONG_CRED,		"WRONG_CRED" }, \
344 		{ NFS4ERR_WRONG_TYPE,		"WRONG_TYPE" }, \
345 		{ NFS4ERR_XDEV,			"XDEV" }, \
346 		/* ***** Internal to Linux NFS client ***** */ \
347 		{ NFS4ERR_RESET_TO_MDS,		"RESET_TO_MDS" }, \
348 		{ NFS4ERR_RESET_TO_PNFS,	"RESET_TO_PNFS" })
349 
350 #define show_nfs4_verifier(x) \
351 	__print_hex_str(x, NFS4_VERIFIER_SIZE)
352 
353 TRACE_DEFINE_ENUM(IOMODE_READ);
354 TRACE_DEFINE_ENUM(IOMODE_RW);
355 TRACE_DEFINE_ENUM(IOMODE_ANY);
356 
357 #define show_pnfs_layout_iomode(x) \
358 	__print_symbolic(x, \
359 		{ IOMODE_READ,			"READ" }, \
360 		{ IOMODE_RW,			"RW" }, \
361 		{ IOMODE_ANY,			"ANY" })
362 
363 #define show_rca_mask(x) \
364 	__print_flags(x, "|", \
365 		{ BIT(RCA4_TYPE_MASK_RDATA_DLG),	"RDATA_DLG" }, \
366 		{ BIT(RCA4_TYPE_MASK_WDATA_DLG),	"WDATA_DLG" }, \
367 		{ BIT(RCA4_TYPE_MASK_DIR_DLG),		"DIR_DLG" }, \
368 		{ BIT(RCA4_TYPE_MASK_FILE_LAYOUT),	"FILE_LAYOUT" }, \
369 		{ BIT(RCA4_TYPE_MASK_BLK_LAYOUT),	"BLK_LAYOUT" }, \
370 		{ BIT(RCA4_TYPE_MASK_OBJ_LAYOUT_MIN),	"OBJ_LAYOUT_MIN" }, \
371 		{ BIT(RCA4_TYPE_MASK_OBJ_LAYOUT_MAX),	"OBJ_LAYOUT_MAX" }, \
372 		{ BIT(RCA4_TYPE_MASK_OTHER_LAYOUT_MIN),	"OTHER_LAYOUT_MIN" }, \
373 		{ BIT(RCA4_TYPE_MASK_OTHER_LAYOUT_MAX),	"OTHER_LAYOUT_MAX" })
374 
375 #define show_nfs4_seq4_status(x) \
376 	__print_flags(x, "|", \
377 		{ SEQ4_STATUS_CB_PATH_DOWN,		"CB_PATH_DOWN" }, \
378 		{ SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING,	"CB_GSS_CONTEXTS_EXPIRING" }, \
379 		{ SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED,	"CB_GSS_CONTEXTS_EXPIRED" }, \
380 		{ SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, "EXPIRED_ALL_STATE_REVOKED" }, \
381 		{ SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, "EXPIRED_SOME_STATE_REVOKED" }, \
382 		{ SEQ4_STATUS_ADMIN_STATE_REVOKED,	"ADMIN_STATE_REVOKED" }, \
383 		{ SEQ4_STATUS_RECALLABLE_STATE_REVOKED,	"RECALLABLE_STATE_REVOKED" }, \
384 		{ SEQ4_STATUS_LEASE_MOVED,		"LEASE_MOVED" }, \
385 		{ SEQ4_STATUS_RESTART_RECLAIM_NEEDED,	"RESTART_RECLAIM_NEEDED" }, \
386 		{ SEQ4_STATUS_CB_PATH_DOWN_SESSION,	"CB_PATH_DOWN_SESSION" }, \
387 		{ SEQ4_STATUS_BACKCHANNEL_FAULT,	"BACKCHANNEL_FAULT" })
388