+/*
+ * NFS attribute management stuff
+ */
+#define NFS_ATTR_BITMAP_LEN 2
+#define NFS_BITMAP_SET(B, I) (((uint32_t *)(B))[(I)/32] |= 1<<((I)%32))
+#define NFS_BITMAP_CLR(B, I) (((uint32_t *)(B))[(I)/32] &= ~(1<<((I)%32)))
+#define NFS_BITMAP_ISSET(B, I) (((uint32_t *)(B))[(I)/32] & (1<<((I)%32)))
+#define NFS_BITMAP_ZERO(B, L) \
+ do { \
+ int __i; \
+ for (__i=0; __i < (L); __i++) \
+ ((uint32_t*)(B))[__i] = 0; \
+ } while (0)
+
+extern uint32_t nfs_fs_attr_bitmap[NFS_ATTR_BITMAP_LEN];
+extern uint32_t nfs_object_attr_bitmap[NFS_ATTR_BITMAP_LEN];
+extern uint32_t nfs_getattr_bitmap[NFS_ATTR_BITMAP_LEN];
+
+#define NFS_CLEAR_ATTRIBUTES(A) NFS_BITMAP_ZERO((A), NFS_ATTR_BITMAP_LEN)
+#define NFS_COPY_ATTRIBUTES(SRC, DST) \
+ do { \
+ int __i; \
+ for (__i=0; __i < NFS_ATTR_BITMAP_LEN; __i++) \
+ ((uint32_t*)(DST))[__i] = ((uint32_t*)(SRC))[__i]; \
+ } while (0)
+
+/* NFS attributes */
+#define NFS_FATTR_SUPPORTED_ATTRS 0
+#define NFS_FATTR_TYPE 1
+#define NFS_FATTR_FH_EXPIRE_TYPE 2
+#define NFS_FATTR_CHANGE 3
+#define NFS_FATTR_SIZE 4
+#define NFS_FATTR_LINK_SUPPORT 5
+#define NFS_FATTR_SYMLINK_SUPPORT 6
+#define NFS_FATTR_NAMED_ATTR 7
+#define NFS_FATTR_FSID 8
+#define NFS_FATTR_UNIQUE_HANDLES 9
+#define NFS_FATTR_LEASE_TIME 10
+#define NFS_FATTR_RDATTR_ERROR 11
+#define NFS_FATTR_FILEHANDLE 19
+#define NFS_FATTR_ACL 12
+#define NFS_FATTR_ACLSUPPORT 13
+#define NFS_FATTR_ARCHIVE 14
+#define NFS_FATTR_CANSETTIME 15
+#define NFS_FATTR_CASE_INSENSITIVE 16
+#define NFS_FATTR_CASE_PRESERVING 17
+#define NFS_FATTR_CHOWN_RESTRICTED 18
+#define NFS_FATTR_FILEID 20
+#define NFS_FATTR_FILES_AVAIL 21
+#define NFS_FATTR_FILES_FREE 22
+#define NFS_FATTR_FILES_TOTAL 23
+#define NFS_FATTR_FS_LOCATIONS 24
+#define NFS_FATTR_HIDDEN 25
+#define NFS_FATTR_HOMOGENEOUS 26
+#define NFS_FATTR_MAXFILESIZE 27
+#define NFS_FATTR_MAXLINK 28
+#define NFS_FATTR_MAXNAME 29
+#define NFS_FATTR_MAXREAD 30
+#define NFS_FATTR_MAXWRITE 31
+#define NFS_FATTR_MIMETYPE 32
+#define NFS_FATTR_MODE 33
+#define NFS_FATTR_NO_TRUNC 34
+#define NFS_FATTR_NUMLINKS 35
+#define NFS_FATTR_OWNER 36
+#define NFS_FATTR_OWNER_GROUP 37
+#define NFS_FATTR_QUOTA_AVAIL_HARD 38
+#define NFS_FATTR_QUOTA_AVAIL_SOFT 39
+#define NFS_FATTR_QUOTA_USED 40
+#define NFS_FATTR_RAWDEV 41
+#define NFS_FATTR_SPACE_AVAIL 42
+#define NFS_FATTR_SPACE_FREE 43
+#define NFS_FATTR_SPACE_TOTAL 44
+#define NFS_FATTR_SPACE_USED 45
+#define NFS_FATTR_SYSTEM 46
+#define NFS_FATTR_TIME_ACCESS 47
+#define NFS_FATTR_TIME_ACCESS_SET 48
+#define NFS_FATTR_TIME_BACKUP 49
+#define NFS_FATTR_TIME_CREATE 50
+#define NFS_FATTR_TIME_DELTA 51
+#define NFS_FATTR_TIME_METADATA 52
+#define NFS_FATTR_TIME_MODIFY 53
+#define NFS_FATTR_TIME_MODIFY_SET 54
+#define NFS_FATTR_MOUNTED_ON_FILEID 55
+
+#define NFS4_ALL_ATTRIBUTES(A) \
+ do { \
+ /* required: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FSID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); \
+ /* optional: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_ACL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \
+ NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MODE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \
+ NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_HARD); \
+ NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_SOFT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_USED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS_SET); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY_SET); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \
+ } while (0)
+
+#define NFS4_PER_OBJECT_ATTRIBUTES(A) \
+ do { \
+ /* required: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FSID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); \
+ /* optional: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_ACL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MODE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \
+ NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \
+ } while (0)
+
+#define NFS4_PER_FS_ATTRIBUTES(A) \
+ do { \
+ /* required: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \
+ /* optional: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); \
+ } while (0)
+
+#define NFS4_DEFAULT_ATTRIBUTES(A) \
+ do { \
+ /* required: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FSID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \
+ NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); */ \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); */ \
+ /* optional: */ \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_ACL); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \
+ NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \
+ NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \
+ NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \
+ NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_MODE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \
+ NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \
+ NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_HARD); */ \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_SOFT); */ \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_USED); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS_SET); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \
+ NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \
+ /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY_SET); */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \
+ } while (0)
+
+/* attributes requested when we want to do a "statfs" */
+#define NFS4_STATFS_ATTRIBUTES(A) \
+ do { \
+ /* optional: */ \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \
+ NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \
+ } while (0)
+
+/*
+ * NFS OPEN constants
+ */
+/* open type */
+#define NFS_OPEN_NOCREATE 0
+#define NFS_OPEN_CREATE 1
+/* delegation space limit */
+#define NFS_LIMIT_SIZE 1
+#define NFS_LIMIT_BLOCKS 2
+/* access/deny modes */
+#define NFS_OPEN_SHARE_ACCESS_NONE 0x00000000
+#define NFS_OPEN_SHARE_ACCESS_READ 0x00000001
+#define NFS_OPEN_SHARE_ACCESS_WRITE 0x00000002
+#define NFS_OPEN_SHARE_ACCESS_BOTH 0x00000003
+#define NFS_OPEN_SHARE_DENY_NONE 0x00000000
+#define NFS_OPEN_SHARE_DENY_READ 0x00000001
+#define NFS_OPEN_SHARE_DENY_WRITE 0x00000002
+#define NFS_OPEN_SHARE_DENY_BOTH 0x00000003
+/* delegation types */
+#define NFS_OPEN_DELEGATE_NONE 0
+#define NFS_OPEN_DELEGATE_READ 1
+#define NFS_OPEN_DELEGATE_WRITE 2
+/* delegation claim types */
+#define NFS_CLAIM_NULL 0
+#define NFS_CLAIM_PREVIOUS 1
+#define NFS_CLAIM_DELEGATE_CUR 2
+#define NFS_CLAIM_DELEGATE_PREV 3
+/* open result flags */
+#define NFS_OPEN_RESULT_CONFIRM 0x00000002
+#define NFS_OPEN_RESULT_LOCKTYPE_POSIX 0x00000004
+/* NFS lock types */
+#define NFS_LOCK_TYPE_READ 1
+#define NFS_LOCK_TYPE_WRITE 2
+#define NFS_LOCK_TYPE_READW 3 /* "blocking" */
+#define NFS_LOCK_TYPE_WRITEW 4 /* "blocking" */
+
+/* NFSv4 RPC procedures */
+#define NFSPROC4_NULL 0
+#define NFSPROC4_COMPOUND 1
+#define NFSPROC4_CB_NULL 0
+#define NFSPROC4_CB_COMPOUND 1
+
+/* NFSv4 opcodes */
+#define NFS_OP_ACCESS 3
+#define NFS_OP_CLOSE 4
+#define NFS_OP_COMMIT 5
+#define NFS_OP_CREATE 6
+#define NFS_OP_DELEGPURGE 7
+#define NFS_OP_DELEGRETURN 8
+#define NFS_OP_GETATTR 9
+#define NFS_OP_GETFH 10
+#define NFS_OP_LINK 11
+#define NFS_OP_LOCK 12
+#define NFS_OP_LOCKT 13
+#define NFS_OP_LOCKU 14
+#define NFS_OP_LOOKUP 15
+#define NFS_OP_LOOKUPP 16
+#define NFS_OP_NVERIFY 17
+#define NFS_OP_OPEN 18
+#define NFS_OP_OPENATTR 19
+#define NFS_OP_OPEN_CONFIRM 20
+#define NFS_OP_OPEN_DOWNGRADE 21
+#define NFS_OP_PUTFH 22
+#define NFS_OP_PUTPUBFH 23
+#define NFS_OP_PUTROOTFH 24
+#define NFS_OP_READ 25
+#define NFS_OP_READDIR 26
+#define NFS_OP_READLINK 27
+#define NFS_OP_REMOVE 28
+#define NFS_OP_RENAME 29
+#define NFS_OP_RENEW 30
+#define NFS_OP_RESTOREFH 31
+#define NFS_OP_SAVEFH 32
+#define NFS_OP_SECINFO 33
+#define NFS_OP_SETATTR 34
+#define NFS_OP_SETCLIENTID 35
+#define NFS_OP_SETCLIENTID_CONFIRM 36
+#define NFS_OP_VERIFY 37
+#define NFS_OP_WRITE 38
+#define NFS_OP_RELEASE_LOCKOWNER 39
+#define NFS_OP_ILLEGAL 10044
+/* NFSv4 callback opcodes */
+#define NFS_OP_CB_GETATTR 3
+#define NFS_OP_CB_RECALL 4
+#define NFS_OP_CB_ILLEGAL 10044
+
+/* NFSv4 file handle type flags */
+#define NFS_FH_PERSISTENT 0x00000000
+#define NFS_FH_NOEXPIRE_WITH_OPEN 0x00000001
+#define NFS_FH_VOLATILE_ANY 0x00000002
+#define NFS_FH_VOL_MIGRATION 0x00000004
+#define NFS_FH_VOL_RENAME 0x00000008
+
+/*
+ * NFSv4 ACL constants
+ */
+/* ACE support mask bits */
+#define NFS_ACL_SUPPORT_ALLOW_ACL 0x00000001
+#define NFS_ACL_SUPPORT_DENY_ACL 0x00000002
+#define NFS_ACL_SUPPORT_AUDIT_ACL 0x00000004
+#define NFS_ACL_SUPPORT_ALARM_ACL 0x00000008
+/* ACE types */
+#define NFS_ACE_ACCESS_ALLOWED_ACE_TYPE 0x00000000
+#define NFS_ACE_ACCESS_DENIED_ACE_TYPE 0x00000001
+#define NFS_ACE_SYSTEM_AUDIT_ACE_TYPE 0x00000002
+#define NFS_ACE_SYSTEM_ALARM_ACE_TYPE 0x00000003
+/* ACE flags */
+#define NFS_ACE_FILE_INHERIT_ACE 0x00000001
+#define NFS_ACE_DIRECTORY_INHERIT_ACE 0x00000002
+#define NFS_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
+#define NFS_ACE_INHERIT_ONLY_ACE 0x00000008
+#define NFS_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
+#define NFS_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
+#define NFS_ACE_IDENTIFIER_GROUP 0x00000040
+#define NFS_ACE_INHERITED_ACE 0x00000080
+/* ACE mask flags */
+#define NFS_ACE_READ_DATA 0x00000001
+#define NFS_ACE_LIST_DIRECTORY 0x00000001
+#define NFS_ACE_WRITE_DATA 0x00000002
+#define NFS_ACE_ADD_FILE 0x00000002
+#define NFS_ACE_APPEND_DATA 0x00000004
+#define NFS_ACE_ADD_SUBDIRECTORY 0x00000004
+#define NFS_ACE_READ_NAMED_ATTRS 0x00000008
+#define NFS_ACE_WRITE_NAMED_ATTRS 0x00000010
+#define NFS_ACE_EXECUTE 0x00000020
+#define NFS_ACE_DELETE_CHILD 0x00000040
+#define NFS_ACE_READ_ATTRIBUTES 0x00000080
+#define NFS_ACE_WRITE_ATTRIBUTES 0x00000100
+#define NFS_ACE_DELETE 0x00010000
+#define NFS_ACE_READ_ACL 0x00020000
+#define NFS_ACE_WRITE_ACL 0x00040000
+#define NFS_ACE_WRITE_OWNER 0x00080000
+#define NFS_ACE_SYNCHRONIZE 0x00100000
+#define NFS_ACE_GENERIC_READ 0x00120081
+#define NFS_ACE_GENERIC_WRITE 0x00160106
+#define NFS_ACE_GENERIC_EXECUTE 0x001200A0