1 /* SPDX-License-Identifier: GPL-2.0 */
5 * NFSv4 protocol definitions.
7 * Copyright (c) 2002 The Regents of the University of Michigan.
10 * Kendrick Smith <kmsmith@umich.edu>
11 * Andy Adamson <andros@umich.edu>
16 #include <linux/list.h>
17 #include <linux/uidgid.h>
18 #include <uapi/linux/nfs4.h>
19 #include <linux/sunrpc/msg_prot.h>
21 enum nfs4_acl_whotype {
22 NFS4_ACL_WHO_NAMED = 0,
25 NFS4_ACL_WHO_EVERYONE,
41 struct nfs4_ace aces[0];
44 #define NFS4_MAXLABELLEN 2048
53 typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
55 struct nfs4_stateid_struct {
57 char data[NFS4_STATEID_SIZE];
60 char other[NFS4_STATEID_OTHER_SIZE];
61 } __attribute__ ((packed));
65 NFS4_INVALID_STATEID_TYPE = 0,
66 NFS4_SPECIAL_STATEID_TYPE,
67 NFS4_OPEN_STATEID_TYPE,
68 NFS4_LOCK_STATEID_TYPE,
69 NFS4_DELEGATION_STATEID_TYPE,
70 NFS4_LAYOUT_STATEID_TYPE,
71 NFS4_PNFS_DS_STATEID_TYPE,
72 NFS4_REVOKED_STATEID_TYPE,
76 typedef struct nfs4_stateid_struct nfs4_stateid;
97 OP_OPEN_DOWNGRADE = 21,
112 OP_SETCLIENTID_CONFIRM = 36,
115 OP_RELEASE_LOCKOWNER = 39,
118 OP_BACKCHANNEL_CTL = 40,
119 OP_BIND_CONN_TO_SESSION = 41,
121 OP_CREATE_SESSION = 43,
122 OP_DESTROY_SESSION = 44,
123 OP_FREE_STATEID = 45,
124 OP_GET_DIR_DELEGATION = 46,
125 OP_GETDEVICEINFO = 47,
126 OP_GETDEVICELIST = 48,
127 OP_LAYOUTCOMMIT = 49,
129 OP_LAYOUTRETURN = 51,
130 OP_SECINFO_NO_NAME = 52,
133 OP_TEST_STATEID = 55,
134 OP_WANT_DELEGATION = 56,
135 OP_DESTROY_CLIENTID = 57,
136 OP_RECLAIM_COMPLETE = 58,
146 OP_OFFLOAD_CANCEL = 66,
147 OP_OFFLOAD_STATUS = 67,
156 /*Defining first and last NFS4 operations implemented.
157 Needs to be updated if more operations are defined in future.*/
159 #define FIRST_NFS4_OP OP_ACCESS
160 #define LAST_NFS40_OP OP_RELEASE_LOCKOWNER
161 #define LAST_NFS41_OP OP_RECLAIM_COMPLETE
162 #define LAST_NFS42_OP OP_CLONE
163 #define LAST_NFS4_OP LAST_NFS42_OP
174 /* Unused/reserved 19 */
182 NFS4ERR_NAMETOOLONG = 63,
183 NFS4ERR_NOTEMPTY = 66,
186 NFS4ERR_BADHANDLE = 10001,
187 NFS4ERR_BAD_COOKIE = 10003,
188 NFS4ERR_NOTSUPP = 10004,
189 NFS4ERR_TOOSMALL = 10005,
190 NFS4ERR_SERVERFAULT = 10006,
191 NFS4ERR_BADTYPE = 10007,
192 NFS4ERR_DELAY = 10008,
193 NFS4ERR_SAME = 10009,
194 NFS4ERR_DENIED = 10010,
195 NFS4ERR_EXPIRED = 10011,
196 NFS4ERR_LOCKED = 10012,
197 NFS4ERR_GRACE = 10013,
198 NFS4ERR_FHEXPIRED = 10014,
199 NFS4ERR_SHARE_DENIED = 10015,
200 NFS4ERR_WRONGSEC = 10016,
201 NFS4ERR_CLID_INUSE = 10017,
202 NFS4ERR_RESOURCE = 10018,
203 NFS4ERR_MOVED = 10019,
204 NFS4ERR_NOFILEHANDLE = 10020,
205 NFS4ERR_MINOR_VERS_MISMATCH = 10021,
206 NFS4ERR_STALE_CLIENTID = 10022,
207 NFS4ERR_STALE_STATEID = 10023,
208 NFS4ERR_OLD_STATEID = 10024,
209 NFS4ERR_BAD_STATEID = 10025,
210 NFS4ERR_BAD_SEQID = 10026,
211 NFS4ERR_NOT_SAME = 10027,
212 NFS4ERR_LOCK_RANGE = 10028,
213 NFS4ERR_SYMLINK = 10029,
214 NFS4ERR_RESTOREFH = 10030,
215 NFS4ERR_LEASE_MOVED = 10031,
216 NFS4ERR_ATTRNOTSUPP = 10032,
217 NFS4ERR_NO_GRACE = 10033,
218 NFS4ERR_RECLAIM_BAD = 10034,
219 NFS4ERR_RECLAIM_CONFLICT = 10035,
220 NFS4ERR_BADXDR = 10036,
221 NFS4ERR_LOCKS_HELD = 10037,
222 NFS4ERR_OPENMODE = 10038,
223 NFS4ERR_BADOWNER = 10039,
224 NFS4ERR_BADCHAR = 10040,
225 NFS4ERR_BADNAME = 10041,
226 NFS4ERR_BAD_RANGE = 10042,
227 NFS4ERR_LOCK_NOTSUPP = 10043,
228 NFS4ERR_OP_ILLEGAL = 10044,
229 NFS4ERR_DEADLOCK = 10045,
230 NFS4ERR_FILE_OPEN = 10046,
231 NFS4ERR_ADMIN_REVOKED = 10047,
232 NFS4ERR_CB_PATH_DOWN = 10048,
235 NFS4ERR_BADIOMODE = 10049,
236 NFS4ERR_BADLAYOUT = 10050,
237 NFS4ERR_BAD_SESSION_DIGEST = 10051,
238 NFS4ERR_BADSESSION = 10052,
239 NFS4ERR_BADSLOT = 10053,
240 NFS4ERR_COMPLETE_ALREADY = 10054,
241 NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055,
242 NFS4ERR_DELEG_ALREADY_WANTED = 10056,
243 NFS4ERR_BACK_CHAN_BUSY = 10057, /* backchan reqs outstanding */
244 NFS4ERR_LAYOUTTRYLATER = 10058,
245 NFS4ERR_LAYOUTUNAVAILABLE = 10059,
246 NFS4ERR_NOMATCHING_LAYOUT = 10060,
247 NFS4ERR_RECALLCONFLICT = 10061,
248 NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
249 NFS4ERR_SEQ_MISORDERED = 10063, /* unexpected seq.id in req */
250 NFS4ERR_SEQUENCE_POS = 10064, /* [CB_]SEQ. op not 1st op */
251 NFS4ERR_REQ_TOO_BIG = 10065, /* request too big */
252 NFS4ERR_REP_TOO_BIG = 10066, /* reply too big */
253 NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067, /* rep. not all cached */
254 NFS4ERR_RETRY_UNCACHED_REP = 10068, /* retry & rep. uncached */
255 NFS4ERR_UNSAFE_COMPOUND = 10069, /* retry/recovery too hard */
256 NFS4ERR_TOO_MANY_OPS = 10070, /* too many ops in [CB_]COMP */
257 NFS4ERR_OP_NOT_IN_SESSION = 10071, /* op needs [CB_]SEQ. op */
258 NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */
259 /* Error 10073 is unused. */
260 NFS4ERR_CLIENTID_BUSY = 10074, /* clientid has state */
261 NFS4ERR_PNFS_IO_HOLE = 10075, /* IO to _SPARSE file hole */
262 NFS4ERR_SEQ_FALSE_RETRY = 10076, /* retry not original */
263 NFS4ERR_BAD_HIGH_SLOT = 10077, /* sequence arg bad */
264 NFS4ERR_DEADSESSION = 10078, /* persistent session dead */
265 NFS4ERR_ENCR_ALG_UNSUPP = 10079, /* SSV alg mismatch */
266 NFS4ERR_PNFS_NO_LAYOUT = 10080, /* direct I/O with no layout */
267 NFS4ERR_NOT_ONLY_OP = 10081, /* bad compound */
268 NFS4ERR_WRONG_CRED = 10082, /* permissions:state change */
269 NFS4ERR_WRONG_TYPE = 10083, /* current operation mismatch */
270 NFS4ERR_DIRDELEG_UNAVAIL = 10084, /* no directory delegation */
271 NFS4ERR_REJECT_DELEG = 10085, /* on callback */
272 NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */
273 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
276 NFS4ERR_PARTNER_NOTSUPP = 10088,
277 NFS4ERR_PARTNER_NO_AUTH = 10089,
278 NFS4ERR_UNION_NOTSUPP = 10090,
279 NFS4ERR_OFFLOAD_DENIED = 10091,
280 NFS4ERR_WRONG_LFS = 10092,
281 NFS4ERR_BADLABEL = 10093,
282 NFS4ERR_OFFLOAD_NO_REQS = 10094,
285 static inline bool seqid_mutating_err(u32 err)
287 /* See RFC 7530, section 9.1.7 */
289 case NFS4ERR_STALE_CLIENTID:
290 case NFS4ERR_STALE_STATEID:
291 case NFS4ERR_BAD_STATEID:
292 case NFS4ERR_BAD_SEQID:
294 case NFS4ERR_RESOURCE:
295 case NFS4ERR_NOFILEHANDLE:
303 * Note: NF4BAD is not actually part of the protocol; it is just used
304 * internally by nfsd.
308 NF4REG = 1, /* Regular File */
309 NF4DIR = 2, /* Directory */
310 NF4BLK = 3, /* Special File - block device */
311 NF4CHR = 4, /* Special File - character device */
312 NF4LNK = 5, /* Symbolic Link */
313 NF4SOCK = 6, /* Special File - socket */
314 NF4FIFO = 7, /* Special File - fifo */
315 NF4ATTRDIR = 8, /* Attribute Directory */
316 NF4NAMEDATTR = 9 /* Named Attribute */
319 enum open_claim_type4 {
320 NFS4_OPEN_CLAIM_NULL = 0,
321 NFS4_OPEN_CLAIM_PREVIOUS = 1,
322 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
323 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3,
324 NFS4_OPEN_CLAIM_FH = 4, /* 4.1 */
325 NFS4_OPEN_CLAIM_DELEG_CUR_FH = 5, /* 4.1 */
326 NFS4_OPEN_CLAIM_DELEG_PREV_FH = 6, /* 4.1 */
330 NFS4_OPEN_NOCREATE = 0,
335 NFS4_CREATE_UNCHECKED = 0,
336 NFS4_CREATE_GUARDED = 1,
337 NFS4_CREATE_EXCLUSIVE = 2,
339 * New to NFSv4.1. If session is persistent,
340 * GUARDED4 MUST be used. Otherwise, use
341 * EXCLUSIVE4_1 instead of EXCLUSIVE4.
343 NFS4_CREATE_EXCLUSIVE4_1 = 3
348 NFS4_LIMIT_BLOCKS = 2
351 enum open_delegation_type4 {
352 NFS4_OPEN_DELEGATE_NONE = 0,
353 NFS4_OPEN_DELEGATE_READ = 1,
354 NFS4_OPEN_DELEGATE_WRITE = 2,
355 NFS4_OPEN_DELEGATE_NONE_EXT = 3, /* 4.1 */
358 enum why_no_delegation4 { /* new to v4.1 */
362 WND4_NOT_SUPP_FTYPE = 3,
363 WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4,
364 WND4_NOT_SUPP_UPGRADE = 5,
365 WND4_NOT_SUPP_DOWNGRADE = 6,
378 enum change_attr_type4 {
379 NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR = 0,
380 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER = 1,
381 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER_NOPNFS = 2,
382 NFS4_CHANGE_TYPE_IS_TIME_METADATA = 3,
383 NFS4_CHANGE_TYPE_IS_UNDEFINED = 4
386 /* Mandatory Attributes */
387 #define FATTR4_WORD0_SUPPORTED_ATTRS (1UL << 0)
388 #define FATTR4_WORD0_TYPE (1UL << 1)
389 #define FATTR4_WORD0_FH_EXPIRE_TYPE (1UL << 2)
390 #define FATTR4_WORD0_CHANGE (1UL << 3)
391 #define FATTR4_WORD0_SIZE (1UL << 4)
392 #define FATTR4_WORD0_LINK_SUPPORT (1UL << 5)
393 #define FATTR4_WORD0_SYMLINK_SUPPORT (1UL << 6)
394 #define FATTR4_WORD0_NAMED_ATTR (1UL << 7)
395 #define FATTR4_WORD0_FSID (1UL << 8)
396 #define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9)
397 #define FATTR4_WORD0_LEASE_TIME (1UL << 10)
398 #define FATTR4_WORD0_RDATTR_ERROR (1UL << 11)
399 /* Mandatory in NFSv4.1 */
400 #define FATTR4_WORD2_SUPPATTR_EXCLCREAT (1UL << 11)
402 /* Recommended Attributes */
403 #define FATTR4_WORD0_ACL (1UL << 12)
404 #define FATTR4_WORD0_ACLSUPPORT (1UL << 13)
405 #define FATTR4_WORD0_ARCHIVE (1UL << 14)
406 #define FATTR4_WORD0_CANSETTIME (1UL << 15)
407 #define FATTR4_WORD0_CASE_INSENSITIVE (1UL << 16)
408 #define FATTR4_WORD0_CASE_PRESERVING (1UL << 17)
409 #define FATTR4_WORD0_CHOWN_RESTRICTED (1UL << 18)
410 #define FATTR4_WORD0_FILEHANDLE (1UL << 19)
411 #define FATTR4_WORD0_FILEID (1UL << 20)
412 #define FATTR4_WORD0_FILES_AVAIL (1UL << 21)
413 #define FATTR4_WORD0_FILES_FREE (1UL << 22)
414 #define FATTR4_WORD0_FILES_TOTAL (1UL << 23)
415 #define FATTR4_WORD0_FS_LOCATIONS (1UL << 24)
416 #define FATTR4_WORD0_HIDDEN (1UL << 25)
417 #define FATTR4_WORD0_HOMOGENEOUS (1UL << 26)
418 #define FATTR4_WORD0_MAXFILESIZE (1UL << 27)
419 #define FATTR4_WORD0_MAXLINK (1UL << 28)
420 #define FATTR4_WORD0_MAXNAME (1UL << 29)
421 #define FATTR4_WORD0_MAXREAD (1UL << 30)
422 #define FATTR4_WORD0_MAXWRITE (1UL << 31)
423 #define FATTR4_WORD1_MIMETYPE (1UL << 0)
424 #define FATTR4_WORD1_MODE (1UL << 1)
425 #define FATTR4_WORD1_NO_TRUNC (1UL << 2)
426 #define FATTR4_WORD1_NUMLINKS (1UL << 3)
427 #define FATTR4_WORD1_OWNER (1UL << 4)
428 #define FATTR4_WORD1_OWNER_GROUP (1UL << 5)
429 #define FATTR4_WORD1_QUOTA_HARD (1UL << 6)
430 #define FATTR4_WORD1_QUOTA_SOFT (1UL << 7)
431 #define FATTR4_WORD1_QUOTA_USED (1UL << 8)
432 #define FATTR4_WORD1_RAWDEV (1UL << 9)
433 #define FATTR4_WORD1_SPACE_AVAIL (1UL << 10)
434 #define FATTR4_WORD1_SPACE_FREE (1UL << 11)
435 #define FATTR4_WORD1_SPACE_TOTAL (1UL << 12)
436 #define FATTR4_WORD1_SPACE_USED (1UL << 13)
437 #define FATTR4_WORD1_SYSTEM (1UL << 14)
438 #define FATTR4_WORD1_TIME_ACCESS (1UL << 15)
439 #define FATTR4_WORD1_TIME_ACCESS_SET (1UL << 16)
440 #define FATTR4_WORD1_TIME_BACKUP (1UL << 17)
441 #define FATTR4_WORD1_TIME_CREATE (1UL << 18)
442 #define FATTR4_WORD1_TIME_DELTA (1UL << 19)
443 #define FATTR4_WORD1_TIME_METADATA (1UL << 20)
444 #define FATTR4_WORD1_TIME_MODIFY (1UL << 21)
445 #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22)
446 #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23)
447 #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
448 #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0)
449 #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
450 #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4)
451 #define FATTR4_WORD2_CLONE_BLKSIZE (1UL << 13)
452 #define FATTR4_WORD2_CHANGE_ATTR_TYPE (1UL << 15)
453 #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16)
454 #define FATTR4_WORD2_MODE_UMASK (1UL << 17)
456 /* MDS threshold bitmap bits */
457 #define THRESHOLD_RD (1UL << 0)
458 #define THRESHOLD_WR (1UL << 1)
459 #define THRESHOLD_RD_IO (1UL << 2)
460 #define THRESHOLD_WR_IO (1UL << 3)
462 #define NFSPROC4_NULL 0
463 #define NFSPROC4_COMPOUND 1
464 #define NFS4_VERSION 4
465 #define NFS4_MINOR_VERSION 0
470 * Index of predefined Linux client operations
472 * To ensure that /proc/net/rpc/nfs remains correctly ordered, please
473 * append only to this enum when adding new client operations.
477 NFSPROC4_CLNT_NULL = 0, /* Unused */
480 NFSPROC4_CLNT_COMMIT,
482 NFSPROC4_CLNT_OPEN_CONFIRM,
483 NFSPROC4_CLNT_OPEN_NOATTR,
484 NFSPROC4_CLNT_OPEN_DOWNGRADE,
486 NFSPROC4_CLNT_SETATTR,
487 NFSPROC4_CLNT_FSINFO,
489 NFSPROC4_CLNT_SETCLIENTID,
490 NFSPROC4_CLNT_SETCLIENTID_CONFIRM,
494 NFSPROC4_CLNT_ACCESS,
495 NFSPROC4_CLNT_GETATTR,
496 NFSPROC4_CLNT_LOOKUP,
497 NFSPROC4_CLNT_LOOKUP_ROOT,
498 NFSPROC4_CLNT_REMOVE,
499 NFSPROC4_CLNT_RENAME,
501 NFSPROC4_CLNT_SYMLINK,
502 NFSPROC4_CLNT_CREATE,
503 NFSPROC4_CLNT_PATHCONF,
504 NFSPROC4_CLNT_STATFS,
505 NFSPROC4_CLNT_READLINK,
506 NFSPROC4_CLNT_READDIR,
507 NFSPROC4_CLNT_SERVER_CAPS,
508 NFSPROC4_CLNT_DELEGRETURN,
509 NFSPROC4_CLNT_GETACL,
510 NFSPROC4_CLNT_SETACL,
511 NFSPROC4_CLNT_FS_LOCATIONS,
512 NFSPROC4_CLNT_RELEASE_LOCKOWNER,
513 NFSPROC4_CLNT_SECINFO,
514 NFSPROC4_CLNT_FSID_PRESENT,
516 NFSPROC4_CLNT_EXCHANGE_ID,
517 NFSPROC4_CLNT_CREATE_SESSION,
518 NFSPROC4_CLNT_DESTROY_SESSION,
519 NFSPROC4_CLNT_SEQUENCE,
520 NFSPROC4_CLNT_GET_LEASE_TIME,
521 NFSPROC4_CLNT_RECLAIM_COMPLETE,
522 NFSPROC4_CLNT_LAYOUTGET,
523 NFSPROC4_CLNT_GETDEVICEINFO,
524 NFSPROC4_CLNT_LAYOUTCOMMIT,
525 NFSPROC4_CLNT_LAYOUTRETURN,
526 NFSPROC4_CLNT_SECINFO_NO_NAME,
527 NFSPROC4_CLNT_TEST_STATEID,
528 NFSPROC4_CLNT_FREE_STATEID,
529 NFSPROC4_CLNT_GETDEVICELIST,
530 NFSPROC4_CLNT_BIND_CONN_TO_SESSION,
531 NFSPROC4_CLNT_DESTROY_CLIENTID,
534 NFSPROC4_CLNT_ALLOCATE,
535 NFSPROC4_CLNT_DEALLOCATE,
536 NFSPROC4_CLNT_LAYOUTSTATS,
539 NFSPROC4_CLNT_OFFLOAD_CANCEL,
541 NFSPROC4_CLNT_LOOKUPP,
542 NFSPROC4_CLNT_LAYOUTERROR,
544 NFSPROC4_CLNT_COPY_NOTIFY,
548 struct nfs4_sessionid {
549 unsigned char data[NFS4_MAX_SESSIONID_LEN];
552 /* Create Session Flags */
553 #define SESSION4_PERSIST 0x001
554 #define SESSION4_BACK_CHAN 0x002
555 #define SESSION4_RDMA 0x004
557 #define SESSION4_FLAG_MASK_A 0x007
559 enum state_protect_how4 {
565 enum pnfs_layouttype {
566 LAYOUT_NFSV4_1_FILES = 1,
567 LAYOUT_OSD2_OBJECTS = 2,
568 LAYOUT_BLOCK_VOLUME = 3,
569 LAYOUT_FLEX_FILES = 4,
574 /* used for both layout return and recall */
575 enum pnfs_layoutreturn_type {
587 enum pnfs_notify_deviceid_type4 {
588 NOTIFY_DEVICEID4_CHANGE = 1 << 1,
589 NOTIFY_DEVICEID4_DELETE = 1 << 2,
592 enum pnfs_block_volume_type {
593 PNFS_BLOCK_VOLUME_SIMPLE = 0,
594 PNFS_BLOCK_VOLUME_SLICE = 1,
595 PNFS_BLOCK_VOLUME_CONCAT = 2,
596 PNFS_BLOCK_VOLUME_STRIPE = 3,
597 PNFS_BLOCK_VOLUME_SCSI = 4,
600 enum pnfs_block_extent_state {
601 PNFS_BLOCK_READWRITE_DATA = 0,
602 PNFS_BLOCK_READ_DATA = 1,
603 PNFS_BLOCK_INVALID_DATA = 2,
604 PNFS_BLOCK_NONE_DATA = 3,
607 /* on the wire size of a block layout extent */
608 #define PNFS_BLOCK_EXTENT_SIZE \
609 (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE)
611 /* on the wire size of a scsi commit range */
612 #define PNFS_SCSI_RANGE_SIZE \
616 PS_CODE_SET_BINARY = 1,
617 PS_CODE_SET_ASCII = 2,
621 enum scsi_designator_type {
622 PS_DESIGNATOR_T10 = 1,
623 PS_DESIGNATOR_EUI64 = 2,
624 PS_DESIGNATOR_NAA = 3,
625 PS_DESIGNATOR_NAME = 8
628 #define NFL4_UFLG_MASK 0x0000003F
629 #define NFL4_UFLG_DENSE 0x00000001
630 #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002
631 #define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0
633 /* Encoded in the loh_body field of type layouthint4 */
634 enum filelayout_hint_care4 {
635 NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
636 NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
637 NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
638 NFLH4_CARE_STRIPE_COUNT = 0x00000080
641 #define NFS4_DEVICEID4_SIZE 16
643 struct nfs4_deviceid {
644 char data[NFS4_DEVICEID4_SIZE];
648 NFS4_CONTENT_DATA = 0,
649 NFS4_CONTENT_HOLE = 1,
652 enum pnfs_update_layout_reason {
653 PNFS_UPDATE_LAYOUT_UNKNOWN = 0,
654 PNFS_UPDATE_LAYOUT_NO_PNFS,
655 PNFS_UPDATE_LAYOUT_RD_ZEROLEN,
656 PNFS_UPDATE_LAYOUT_MDSTHRESH,
657 PNFS_UPDATE_LAYOUT_NOMEM,
658 PNFS_UPDATE_LAYOUT_BULK_RECALL,
659 PNFS_UPDATE_LAYOUT_IO_TEST_FAIL,
660 PNFS_UPDATE_LAYOUT_FOUND_CACHED,
661 PNFS_UPDATE_LAYOUT_RETURN,
662 PNFS_UPDATE_LAYOUT_RETRY,
663 PNFS_UPDATE_LAYOUT_BLOCKED,
664 PNFS_UPDATE_LAYOUT_INVALID_OPEN,
665 PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET,
666 PNFS_UPDATE_LAYOUT_EXIT,
669 #define NFS4_OP_MAP_NUM_LONGS \
670 DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long))
671 #define NFS4_OP_MAP_NUM_WORDS \
672 (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32))
675 unsigned long longs[NFS4_OP_MAP_NUM_LONGS];
676 u32 words[NFS4_OP_MAP_NUM_WORDS];
680 struct nfs42_netaddr {
681 char netid[RPCBIND_MAXNETIDLEN];
682 char addr[RPCBIND_MAXUADDRLEN + 1];
694 enum netloc_type4 nl4_type;
696 struct { /* NL4_NAME, NL4_URL */
698 char nl4_str[NFS4_OPAQUE_LIMIT + 1];
700 struct nfs42_netaddr nl4_addr; /* NL4_NETADDR */