1 /*
2 * include/linux/nfs4.h
3 *
4 * NFSv4 protocol definitions.
5 *
6 * Copyright (c) 2002 The Regents of the University of Michigan.
7 * All rights reserved.
8 *
9 * Kendrick Smith <kmsmith@umich.edu>
10 * Andy Adamson <andros@umich.edu>
11 */
12 #ifndef _LINUX_NFS4_H
13 #define _LINUX_NFS4_H
14
15 #include <linux/list.h>
16 #include <linux/uidgid.h>
17 #include <uapi/linux/nfs4.h>
18
19 struct nfs4_ace {
20 uint32_t type;
21 uint32_t flag;
22 uint32_t access_mask;
23 int whotype;
24 union {
25 kuid_t who_uid;
26 kgid_t who_gid;
27 };
28 };
29
30 struct nfs4_acl {
31 uint32_t naces;
32 struct nfs4_ace aces[0];
33 };
34
35 typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
36
37 struct nfs_stateid4 {
38 __be32 seqid;
39 char other[NFS4_STATEID_OTHER_SIZE];
40 } __attribute__ ((packed));
41
42 typedef struct nfs_stateid4 nfs4_stateid;
43
44 enum nfs_opnum4 {
45 OP_ACCESS = 3,
46 OP_CLOSE = 4,
47 OP_COMMIT = 5,
48 OP_CREATE = 6,
49 OP_DELEGPURGE = 7,
50 OP_DELEGRETURN = 8,
51 OP_GETATTR = 9,
52 OP_GETFH = 10,
53 OP_LINK = 11,
54 OP_LOCK = 12,
55 OP_LOCKT = 13,
56 OP_LOCKU = 14,
57 OP_LOOKUP = 15,
58 OP_LOOKUPP = 16,
59 OP_NVERIFY = 17,
60 OP_OPEN = 18,
61 OP_OPENATTR = 19,
62 OP_OPEN_CONFIRM = 20,
63 OP_OPEN_DOWNGRADE = 21,
64 OP_PUTFH = 22,
65 OP_PUTPUBFH = 23,
66 OP_PUTROOTFH = 24,
67 OP_READ = 25,
68 OP_READDIR = 26,
69 OP_READLINK = 27,
70 OP_REMOVE = 28,
71 OP_RENAME = 29,
72 OP_RENEW = 30,
73 OP_RESTOREFH = 31,
74 OP_SAVEFH = 32,
75 OP_SECINFO = 33,
76 OP_SETATTR = 34,
77 OP_SETCLIENTID = 35,
78 OP_SETCLIENTID_CONFIRM = 36,
79 OP_VERIFY = 37,
80 OP_WRITE = 38,
81 OP_RELEASE_LOCKOWNER = 39,
82
83 /* nfs41 */
84 OP_BACKCHANNEL_CTL = 40,
85 OP_BIND_CONN_TO_SESSION = 41,
86 OP_EXCHANGE_ID = 42,
87 OP_CREATE_SESSION = 43,
88 OP_DESTROY_SESSION = 44,
89 OP_FREE_STATEID = 45,
90 OP_GET_DIR_DELEGATION = 46,
91 OP_GETDEVICEINFO = 47,
92 OP_GETDEVICELIST = 48,
93 OP_LAYOUTCOMMIT = 49,
94 OP_LAYOUTGET = 50,
95 OP_LAYOUTRETURN = 51,
96 OP_SECINFO_NO_NAME = 52,
97 OP_SEQUENCE = 53,
98 OP_SET_SSV = 54,
99 OP_TEST_STATEID = 55,
100 OP_WANT_DELEGATION = 56,
101 OP_DESTROY_CLIENTID = 57,
102 OP_RECLAIM_COMPLETE = 58,
103
104 OP_ILLEGAL = 10044,
105 };
106
107 /*Defining first and last NFS4 operations implemented.
108 Needs to be updated if more operations are defined in future.*/
109
110 #define FIRST_NFS4_OP OP_ACCESS
111 #define LAST_NFS4_OP OP_RECLAIM_COMPLETE
112
113 enum nfsstat4 {
114 NFS4_OK = 0,
115 NFS4ERR_PERM = 1,
116 NFS4ERR_NOENT = 2,
117 NFS4ERR_IO = 5,
118 NFS4ERR_NXIO = 6,
119 NFS4ERR_ACCESS = 13,
120 NFS4ERR_EXIST = 17,
121 NFS4ERR_XDEV = 18,
122 /* Unused/reserved 19 */
123 NFS4ERR_NOTDIR = 20,
124 NFS4ERR_ISDIR = 21,
125 NFS4ERR_INVAL = 22,
126 NFS4ERR_FBIG = 27,
127 NFS4ERR_NOSPC = 28,
128 NFS4ERR_ROFS = 30,
129 NFS4ERR_MLINK = 31,
130 NFS4ERR_NAMETOOLONG = 63,
131 NFS4ERR_NOTEMPTY = 66,
132 NFS4ERR_DQUOT = 69,
133 NFS4ERR_STALE = 70,
134 NFS4ERR_BADHANDLE = 10001,
135 NFS4ERR_BAD_COOKIE = 10003,
136 NFS4ERR_NOTSUPP = 10004,
137 NFS4ERR_TOOSMALL = 10005,
138 NFS4ERR_SERVERFAULT = 10006,
139 NFS4ERR_BADTYPE = 10007,
140 NFS4ERR_DELAY = 10008,
141 NFS4ERR_SAME = 10009,
142 NFS4ERR_DENIED = 10010,
143 NFS4ERR_EXPIRED = 10011,
144 NFS4ERR_LOCKED = 10012,
145 NFS4ERR_GRACE = 10013,
146 NFS4ERR_FHEXPIRED = 10014,
147 NFS4ERR_SHARE_DENIED = 10015,
148 NFS4ERR_WRONGSEC = 10016,
149 NFS4ERR_CLID_INUSE = 10017,
150 NFS4ERR_RESOURCE = 10018,
151 NFS4ERR_MOVED = 10019,
152 NFS4ERR_NOFILEHANDLE = 10020,
153 NFS4ERR_MINOR_VERS_MISMATCH = 10021,
154 NFS4ERR_STALE_CLIENTID = 10022,
155 NFS4ERR_STALE_STATEID = 10023,
156 NFS4ERR_OLD_STATEID = 10024,
157 NFS4ERR_BAD_STATEID = 10025,
158 NFS4ERR_BAD_SEQID = 10026,
159 NFS4ERR_NOT_SAME = 10027,
160 NFS4ERR_LOCK_RANGE = 10028,
161 NFS4ERR_SYMLINK = 10029,
162 NFS4ERR_RESTOREFH = 10030,
163 NFS4ERR_LEASE_MOVED = 10031,
164 NFS4ERR_ATTRNOTSUPP = 10032,
165 NFS4ERR_NO_GRACE = 10033,
166 NFS4ERR_RECLAIM_BAD = 10034,
167 NFS4ERR_RECLAIM_CONFLICT = 10035,
168 NFS4ERR_BADXDR = 10036,
169 NFS4ERR_LOCKS_HELD = 10037,
170 NFS4ERR_OPENMODE = 10038,
171 NFS4ERR_BADOWNER = 10039,
172 NFS4ERR_BADCHAR = 10040,
173 NFS4ERR_BADNAME = 10041,
174 NFS4ERR_BAD_RANGE = 10042,
175 NFS4ERR_LOCK_NOTSUPP = 10043,
176 NFS4ERR_OP_ILLEGAL = 10044,
177 NFS4ERR_DEADLOCK = 10045,
178 NFS4ERR_FILE_OPEN = 10046,
179 NFS4ERR_ADMIN_REVOKED = 10047,
180 NFS4ERR_CB_PATH_DOWN = 10048,
181
182 /* nfs41 */
183 NFS4ERR_BADIOMODE = 10049,
184 NFS4ERR_BADLAYOUT = 10050,
185 NFS4ERR_BAD_SESSION_DIGEST = 10051,
186 NFS4ERR_BADSESSION = 10052,
187 NFS4ERR_BADSLOT = 10053,
188 NFS4ERR_COMPLETE_ALREADY = 10054,
189 NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055,
190 NFS4ERR_DELEG_ALREADY_WANTED = 10056,
191 NFS4ERR_BACK_CHAN_BUSY = 10057, /* backchan reqs outstanding */
192 NFS4ERR_LAYOUTTRYLATER = 10058,
193 NFS4ERR_LAYOUTUNAVAILABLE = 10059,
194 NFS4ERR_NOMATCHING_LAYOUT = 10060,
195 NFS4ERR_RECALLCONFLICT = 10061,
196 NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
197 NFS4ERR_SEQ_MISORDERED = 10063, /* unexpected seq.id in req */
198 NFS4ERR_SEQUENCE_POS = 10064, /* [CB_]SEQ. op not 1st op */
199 NFS4ERR_REQ_TOO_BIG = 10065, /* request too big */
200 NFS4ERR_REP_TOO_BIG = 10066, /* reply too big */
201 NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067, /* rep. not all cached */
202 NFS4ERR_RETRY_UNCACHED_REP = 10068, /* retry & rep. uncached */
203 NFS4ERR_UNSAFE_COMPOUND = 10069, /* retry/recovery too hard */
204 NFS4ERR_TOO_MANY_OPS = 10070, /* too many ops in [CB_]COMP */
205 NFS4ERR_OP_NOT_IN_SESSION = 10071, /* op needs [CB_]SEQ. op */
206 NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */
207 /* Error 10073 is unused. */
208 NFS4ERR_CLIENTID_BUSY = 10074, /* clientid has state */
209 NFS4ERR_PNFS_IO_HOLE = 10075, /* IO to _SPARSE file hole */
210 NFS4ERR_SEQ_FALSE_RETRY = 10076, /* retry not original */
211 NFS4ERR_BAD_HIGH_SLOT = 10077, /* sequence arg bad */
212 NFS4ERR_DEADSESSION = 10078, /* persistent session dead */
213 NFS4ERR_ENCR_ALG_UNSUPP = 10079, /* SSV alg mismatch */
214 NFS4ERR_PNFS_NO_LAYOUT = 10080, /* direct I/O with no layout */
215 NFS4ERR_NOT_ONLY_OP = 10081, /* bad compound */
216 NFS4ERR_WRONG_CRED = 10082, /* permissions:state change */
217 NFS4ERR_WRONG_TYPE = 10083, /* current operation mismatch */
218 NFS4ERR_DIRDELEG_UNAVAIL = 10084, /* no directory delegation */
219 NFS4ERR_REJECT_DELEG = 10085, /* on callback */
220 NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */
221 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
222 };
223
seqid_mutating_err(u32 err)224 static inline bool seqid_mutating_err(u32 err)
225 {
226 /* rfc 3530 section 8.1.5: */
227 switch (err) {
228 case NFS4ERR_STALE_CLIENTID:
229 case NFS4ERR_STALE_STATEID:
230 case NFS4ERR_BAD_STATEID:
231 case NFS4ERR_BAD_SEQID:
232 case NFS4ERR_BADXDR:
233 case NFS4ERR_RESOURCE:
234 case NFS4ERR_NOFILEHANDLE:
235 return false;
236 };
237 return true;
238 }
239
240 /*
241 * Note: NF4BAD is not actually part of the protocol; it is just used
242 * internally by nfsd.
243 */
244 enum nfs_ftype4 {
245 NF4BAD = 0,
246 NF4REG = 1, /* Regular File */
247 NF4DIR = 2, /* Directory */
248 NF4BLK = 3, /* Special File - block device */
249 NF4CHR = 4, /* Special File - character device */
250 NF4LNK = 5, /* Symbolic Link */
251 NF4SOCK = 6, /* Special File - socket */
252 NF4FIFO = 7, /* Special File - fifo */
253 NF4ATTRDIR = 8, /* Attribute Directory */
254 NF4NAMEDATTR = 9 /* Named Attribute */
255 };
256
257 enum open_claim_type4 {
258 NFS4_OPEN_CLAIM_NULL = 0,
259 NFS4_OPEN_CLAIM_PREVIOUS = 1,
260 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
261 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3,
262 NFS4_OPEN_CLAIM_FH = 4, /* 4.1 */
263 NFS4_OPEN_CLAIM_DELEG_CUR_FH = 5, /* 4.1 */
264 NFS4_OPEN_CLAIM_DELEG_PREV_FH = 6, /* 4.1 */
265 };
266
267 enum opentype4 {
268 NFS4_OPEN_NOCREATE = 0,
269 NFS4_OPEN_CREATE = 1
270 };
271
272 enum createmode4 {
273 NFS4_CREATE_UNCHECKED = 0,
274 NFS4_CREATE_GUARDED = 1,
275 NFS4_CREATE_EXCLUSIVE = 2,
276 /*
277 * New to NFSv4.1. If session is persistent,
278 * GUARDED4 MUST be used. Otherwise, use
279 * EXCLUSIVE4_1 instead of EXCLUSIVE4.
280 */
281 NFS4_CREATE_EXCLUSIVE4_1 = 3
282 };
283
284 enum limit_by4 {
285 NFS4_LIMIT_SIZE = 1,
286 NFS4_LIMIT_BLOCKS = 2
287 };
288
289 enum open_delegation_type4 {
290 NFS4_OPEN_DELEGATE_NONE = 0,
291 NFS4_OPEN_DELEGATE_READ = 1,
292 NFS4_OPEN_DELEGATE_WRITE = 2,
293 NFS4_OPEN_DELEGATE_NONE_EXT = 3, /* 4.1 */
294 };
295
296 enum why_no_delegation4 { /* new to v4.1 */
297 WND4_NOT_WANTED = 0,
298 WND4_CONTENTION = 1,
299 WND4_RESOURCE = 2,
300 WND4_NOT_SUPP_FTYPE = 3,
301 WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4,
302 WND4_NOT_SUPP_UPGRADE = 5,
303 WND4_NOT_SUPP_DOWNGRADE = 6,
304 WND4_CANCELLED = 7,
305 WND4_IS_DIR = 8,
306 };
307
308 enum lock_type4 {
309 NFS4_UNLOCK_LT = 0,
310 NFS4_READ_LT = 1,
311 NFS4_WRITE_LT = 2,
312 NFS4_READW_LT = 3,
313 NFS4_WRITEW_LT = 4
314 };
315
316
317 /* Mandatory Attributes */
318 #define FATTR4_WORD0_SUPPORTED_ATTRS (1UL << 0)
319 #define FATTR4_WORD0_TYPE (1UL << 1)
320 #define FATTR4_WORD0_FH_EXPIRE_TYPE (1UL << 2)
321 #define FATTR4_WORD0_CHANGE (1UL << 3)
322 #define FATTR4_WORD0_SIZE (1UL << 4)
323 #define FATTR4_WORD0_LINK_SUPPORT (1UL << 5)
324 #define FATTR4_WORD0_SYMLINK_SUPPORT (1UL << 6)
325 #define FATTR4_WORD0_NAMED_ATTR (1UL << 7)
326 #define FATTR4_WORD0_FSID (1UL << 8)
327 #define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9)
328 #define FATTR4_WORD0_LEASE_TIME (1UL << 10)
329 #define FATTR4_WORD0_RDATTR_ERROR (1UL << 11)
330 /* Mandatory in NFSv4.1 */
331 #define FATTR4_WORD2_SUPPATTR_EXCLCREAT (1UL << 11)
332
333 /* Recommended Attributes */
334 #define FATTR4_WORD0_ACL (1UL << 12)
335 #define FATTR4_WORD0_ACLSUPPORT (1UL << 13)
336 #define FATTR4_WORD0_ARCHIVE (1UL << 14)
337 #define FATTR4_WORD0_CANSETTIME (1UL << 15)
338 #define FATTR4_WORD0_CASE_INSENSITIVE (1UL << 16)
339 #define FATTR4_WORD0_CASE_PRESERVING (1UL << 17)
340 #define FATTR4_WORD0_CHOWN_RESTRICTED (1UL << 18)
341 #define FATTR4_WORD0_FILEHANDLE (1UL << 19)
342 #define FATTR4_WORD0_FILEID (1UL << 20)
343 #define FATTR4_WORD0_FILES_AVAIL (1UL << 21)
344 #define FATTR4_WORD0_FILES_FREE (1UL << 22)
345 #define FATTR4_WORD0_FILES_TOTAL (1UL << 23)
346 #define FATTR4_WORD0_FS_LOCATIONS (1UL << 24)
347 #define FATTR4_WORD0_HIDDEN (1UL << 25)
348 #define FATTR4_WORD0_HOMOGENEOUS (1UL << 26)
349 #define FATTR4_WORD0_MAXFILESIZE (1UL << 27)
350 #define FATTR4_WORD0_MAXLINK (1UL << 28)
351 #define FATTR4_WORD0_MAXNAME (1UL << 29)
352 #define FATTR4_WORD0_MAXREAD (1UL << 30)
353 #define FATTR4_WORD0_MAXWRITE (1UL << 31)
354 #define FATTR4_WORD1_MIMETYPE (1UL << 0)
355 #define FATTR4_WORD1_MODE (1UL << 1)
356 #define FATTR4_WORD1_NO_TRUNC (1UL << 2)
357 #define FATTR4_WORD1_NUMLINKS (1UL << 3)
358 #define FATTR4_WORD1_OWNER (1UL << 4)
359 #define FATTR4_WORD1_OWNER_GROUP (1UL << 5)
360 #define FATTR4_WORD1_QUOTA_HARD (1UL << 6)
361 #define FATTR4_WORD1_QUOTA_SOFT (1UL << 7)
362 #define FATTR4_WORD1_QUOTA_USED (1UL << 8)
363 #define FATTR4_WORD1_RAWDEV (1UL << 9)
364 #define FATTR4_WORD1_SPACE_AVAIL (1UL << 10)
365 #define FATTR4_WORD1_SPACE_FREE (1UL << 11)
366 #define FATTR4_WORD1_SPACE_TOTAL (1UL << 12)
367 #define FATTR4_WORD1_SPACE_USED (1UL << 13)
368 #define FATTR4_WORD1_SYSTEM (1UL << 14)
369 #define FATTR4_WORD1_TIME_ACCESS (1UL << 15)
370 #define FATTR4_WORD1_TIME_ACCESS_SET (1UL << 16)
371 #define FATTR4_WORD1_TIME_BACKUP (1UL << 17)
372 #define FATTR4_WORD1_TIME_CREATE (1UL << 18)
373 #define FATTR4_WORD1_TIME_DELTA (1UL << 19)
374 #define FATTR4_WORD1_TIME_METADATA (1UL << 20)
375 #define FATTR4_WORD1_TIME_MODIFY (1UL << 21)
376 #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22)
377 #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23)
378 #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
379 #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
380 #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4)
381
382 /* MDS threshold bitmap bits */
383 #define THRESHOLD_RD (1UL << 0)
384 #define THRESHOLD_WR (1UL << 1)
385 #define THRESHOLD_RD_IO (1UL << 2)
386 #define THRESHOLD_WR_IO (1UL << 3)
387
388 #define NFSPROC4_NULL 0
389 #define NFSPROC4_COMPOUND 1
390 #define NFS4_VERSION 4
391 #define NFS4_MINOR_VERSION 0
392
393 #if defined(CONFIG_NFS_V4_1)
394 #define NFS4_MAX_MINOR_VERSION 1
395 #else
396 #define NFS4_MAX_MINOR_VERSION 0
397 #endif /* CONFIG_NFS_V4_1 */
398
399 #define NFS4_DEBUG 1
400
401 /* Index of predefined Linux client operations */
402
403 enum {
404 NFSPROC4_CLNT_NULL = 0, /* Unused */
405 NFSPROC4_CLNT_READ,
406 NFSPROC4_CLNT_WRITE,
407 NFSPROC4_CLNT_COMMIT,
408 NFSPROC4_CLNT_OPEN,
409 NFSPROC4_CLNT_OPEN_CONFIRM,
410 NFSPROC4_CLNT_OPEN_NOATTR,
411 NFSPROC4_CLNT_OPEN_DOWNGRADE,
412 NFSPROC4_CLNT_CLOSE,
413 NFSPROC4_CLNT_SETATTR,
414 NFSPROC4_CLNT_FSINFO,
415 NFSPROC4_CLNT_RENEW,
416 NFSPROC4_CLNT_SETCLIENTID,
417 NFSPROC4_CLNT_SETCLIENTID_CONFIRM,
418 NFSPROC4_CLNT_LOCK,
419 NFSPROC4_CLNT_LOCKT,
420 NFSPROC4_CLNT_LOCKU,
421 NFSPROC4_CLNT_ACCESS,
422 NFSPROC4_CLNT_GETATTR,
423 NFSPROC4_CLNT_LOOKUP,
424 NFSPROC4_CLNT_LOOKUP_ROOT,
425 NFSPROC4_CLNT_REMOVE,
426 NFSPROC4_CLNT_RENAME,
427 NFSPROC4_CLNT_LINK,
428 NFSPROC4_CLNT_SYMLINK,
429 NFSPROC4_CLNT_CREATE,
430 NFSPROC4_CLNT_PATHCONF,
431 NFSPROC4_CLNT_STATFS,
432 NFSPROC4_CLNT_READLINK,
433 NFSPROC4_CLNT_READDIR,
434 NFSPROC4_CLNT_SERVER_CAPS,
435 NFSPROC4_CLNT_DELEGRETURN,
436 NFSPROC4_CLNT_GETACL,
437 NFSPROC4_CLNT_SETACL,
438 NFSPROC4_CLNT_FS_LOCATIONS,
439 NFSPROC4_CLNT_RELEASE_LOCKOWNER,
440 NFSPROC4_CLNT_SECINFO,
441
442 /* nfs41 */
443 NFSPROC4_CLNT_EXCHANGE_ID,
444 NFSPROC4_CLNT_CREATE_SESSION,
445 NFSPROC4_CLNT_DESTROY_SESSION,
446 NFSPROC4_CLNT_SEQUENCE,
447 NFSPROC4_CLNT_GET_LEASE_TIME,
448 NFSPROC4_CLNT_RECLAIM_COMPLETE,
449 NFSPROC4_CLNT_LAYOUTGET,
450 NFSPROC4_CLNT_GETDEVICEINFO,
451 NFSPROC4_CLNT_LAYOUTCOMMIT,
452 NFSPROC4_CLNT_LAYOUTRETURN,
453 NFSPROC4_CLNT_SECINFO_NO_NAME,
454 NFSPROC4_CLNT_TEST_STATEID,
455 NFSPROC4_CLNT_FREE_STATEID,
456 NFSPROC4_CLNT_GETDEVICELIST,
457 NFSPROC4_CLNT_BIND_CONN_TO_SESSION,
458 NFSPROC4_CLNT_DESTROY_CLIENTID,
459 };
460
461 /* nfs41 types */
462 struct nfs4_sessionid {
463 unsigned char data[NFS4_MAX_SESSIONID_LEN];
464 };
465
466 /* Create Session Flags */
467 #define SESSION4_PERSIST 0x001
468 #define SESSION4_BACK_CHAN 0x002
469 #define SESSION4_RDMA 0x004
470
471 #define SESSION4_FLAG_MASK_A 0x007
472
473 enum state_protect_how4 {
474 SP4_NONE = 0,
475 SP4_MACH_CRED = 1,
476 SP4_SSV = 2
477 };
478
479 enum pnfs_layouttype {
480 LAYOUT_NFSV4_1_FILES = 1,
481 LAYOUT_OSD2_OBJECTS = 2,
482 LAYOUT_BLOCK_VOLUME = 3,
483 };
484
485 /* used for both layout return and recall */
486 enum pnfs_layoutreturn_type {
487 RETURN_FILE = 1,
488 RETURN_FSID = 2,
489 RETURN_ALL = 3
490 };
491
492 enum pnfs_iomode {
493 IOMODE_READ = 1,
494 IOMODE_RW = 2,
495 IOMODE_ANY = 3,
496 };
497
498 enum pnfs_notify_deviceid_type4 {
499 NOTIFY_DEVICEID4_CHANGE = 1 << 1,
500 NOTIFY_DEVICEID4_DELETE = 1 << 2,
501 };
502
503 #define NFL4_UFLG_MASK 0x0000003F
504 #define NFL4_UFLG_DENSE 0x00000001
505 #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002
506 #define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0
507
508 /* Encoded in the loh_body field of type layouthint4 */
509 enum filelayout_hint_care4 {
510 NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
511 NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
512 NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
513 NFLH4_CARE_STRIPE_COUNT = 0x00000080
514 };
515
516 #define NFS4_DEVICEID4_SIZE 16
517
518 struct nfs4_deviceid {
519 char data[NFS4_DEVICEID4_SIZE];
520 };
521
522 #endif
523