Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #ifndef _LINUX_NFS4_H |
| 13 | #define _LINUX_NFS4_H |
| 14 | |
David Woodhouse | 997b7af | 2006-04-25 14:51:45 +0100 | [diff] [blame] | 15 | #include <linux/list.h> |
Eric W. Biederman | ab8e4ae | 2013-02-02 05:18:08 -0800 | [diff] [blame] | 16 | #include <linux/uidgid.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 17 | #include <uapi/linux/nfs4.h> |
David Woodhouse | 997b7af | 2006-04-25 14:51:45 +0100 | [diff] [blame] | 18 | |
Andreas Gruenbacher | bff1752 | 2015-03-27 17:50:00 +0100 | [diff] [blame] | 19 | enum nfs4_acl_whotype { |
| 20 | NFS4_ACL_WHO_NAMED = 0, |
| 21 | NFS4_ACL_WHO_OWNER, |
| 22 | NFS4_ACL_WHO_GROUP, |
| 23 | NFS4_ACL_WHO_EVERYONE, |
| 24 | }; |
| 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | struct nfs4_ace { |
| 27 | uint32_t type; |
| 28 | uint32_t flag; |
| 29 | uint32_t access_mask; |
| 30 | int whotype; |
Eric W. Biederman | ab8e4ae | 2013-02-02 05:18:08 -0800 | [diff] [blame] | 31 | union { |
| 32 | kuid_t who_uid; |
| 33 | kgid_t who_gid; |
| 34 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | struct nfs4_acl { |
| 38 | uint32_t naces; |
J. Bruce Fields | 28e05dd | 2007-02-16 01:28:30 -0800 | [diff] [blame] | 39 | struct nfs4_ace aces[0]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
Steve Dickson | e058f70 | 2013-05-22 12:50:40 -0400 | [diff] [blame] | 42 | #define NFS4_MAXLABELLEN 2048 |
| 43 | |
| 44 | struct nfs4_label { |
| 45 | uint32_t lfs; |
| 46 | uint32_t pi; |
| 47 | u32 len; |
| 48 | char *label; |
| 49 | }; |
| 50 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
Alexandros Batsakis | 9449925 | 2010-10-20 00:17:56 -0400 | [diff] [blame] | 52 | |
Trond Myklebust | 93b717f | 2016-05-16 17:42:43 -0400 | [diff] [blame] | 53 | struct nfs4_stateid_struct { |
| 54 | union { |
| 55 | char data[NFS4_STATEID_SIZE]; |
| 56 | struct { |
| 57 | __be32 seqid; |
| 58 | char other[NFS4_STATEID_OTHER_SIZE]; |
| 59 | } __attribute__ ((packed)); |
| 60 | }; |
Alexandros Batsakis | 9449925 | 2010-10-20 00:17:56 -0400 | [diff] [blame] | 61 | |
Trond Myklebust | 93b717f | 2016-05-16 17:42:43 -0400 | [diff] [blame] | 62 | enum { |
| 63 | NFS4_INVALID_STATEID_TYPE = 0, |
| 64 | NFS4_SPECIAL_STATEID_TYPE, |
| 65 | NFS4_OPEN_STATEID_TYPE, |
| 66 | NFS4_LOCK_STATEID_TYPE, |
| 67 | NFS4_DELEGATION_STATEID_TYPE, |
| 68 | NFS4_LAYOUT_STATEID_TYPE, |
| 69 | NFS4_PNFS_DS_STATEID_TYPE, |
Trond Myklebust | f7a62ad | 2016-09-22 13:39:02 -0400 | [diff] [blame] | 70 | NFS4_REVOKED_STATEID_TYPE, |
Trond Myklebust | 93b717f | 2016-05-16 17:42:43 -0400 | [diff] [blame] | 71 | } type; |
| 72 | }; |
| 73 | |
| 74 | typedef struct nfs4_stateid_struct nfs4_stateid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
| 76 | enum nfs_opnum4 { |
| 77 | OP_ACCESS = 3, |
| 78 | OP_CLOSE = 4, |
| 79 | OP_COMMIT = 5, |
| 80 | OP_CREATE = 6, |
| 81 | OP_DELEGPURGE = 7, |
| 82 | OP_DELEGRETURN = 8, |
| 83 | OP_GETATTR = 9, |
| 84 | OP_GETFH = 10, |
| 85 | OP_LINK = 11, |
| 86 | OP_LOCK = 12, |
| 87 | OP_LOCKT = 13, |
| 88 | OP_LOCKU = 14, |
| 89 | OP_LOOKUP = 15, |
| 90 | OP_LOOKUPP = 16, |
| 91 | OP_NVERIFY = 17, |
| 92 | OP_OPEN = 18, |
| 93 | OP_OPENATTR = 19, |
| 94 | OP_OPEN_CONFIRM = 20, |
| 95 | OP_OPEN_DOWNGRADE = 21, |
| 96 | OP_PUTFH = 22, |
| 97 | OP_PUTPUBFH = 23, |
| 98 | OP_PUTROOTFH = 24, |
| 99 | OP_READ = 25, |
| 100 | OP_READDIR = 26, |
| 101 | OP_READLINK = 27, |
| 102 | OP_REMOVE = 28, |
| 103 | OP_RENAME = 29, |
| 104 | OP_RENEW = 30, |
| 105 | OP_RESTOREFH = 31, |
| 106 | OP_SAVEFH = 32, |
| 107 | OP_SECINFO = 33, |
| 108 | OP_SETATTR = 34, |
| 109 | OP_SETCLIENTID = 35, |
| 110 | OP_SETCLIENTID_CONFIRM = 36, |
| 111 | OP_VERIFY = 37, |
| 112 | OP_WRITE = 38, |
| 113 | OP_RELEASE_LOCKOWNER = 39, |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 114 | |
| 115 | /* nfs41 */ |
| 116 | OP_BACKCHANNEL_CTL = 40, |
| 117 | OP_BIND_CONN_TO_SESSION = 41, |
| 118 | OP_EXCHANGE_ID = 42, |
| 119 | OP_CREATE_SESSION = 43, |
| 120 | OP_DESTROY_SESSION = 44, |
| 121 | OP_FREE_STATEID = 45, |
| 122 | OP_GET_DIR_DELEGATION = 46, |
| 123 | OP_GETDEVICEINFO = 47, |
| 124 | OP_GETDEVICELIST = 48, |
| 125 | OP_LAYOUTCOMMIT = 49, |
| 126 | OP_LAYOUTGET = 50, |
| 127 | OP_LAYOUTRETURN = 51, |
| 128 | OP_SECINFO_NO_NAME = 52, |
| 129 | OP_SEQUENCE = 53, |
| 130 | OP_SET_SSV = 54, |
| 131 | OP_TEST_STATEID = 55, |
| 132 | OP_WANT_DELEGATION = 56, |
| 133 | OP_DESTROY_CLIENTID = 57, |
| 134 | OP_RECLAIM_COMPLETE = 58, |
| 135 | |
Anna Schumaker | 87a15a8 | 2014-09-26 13:58:26 -0400 | [diff] [blame] | 136 | /* nfs42 */ |
| 137 | OP_ALLOCATE = 59, |
| 138 | OP_COPY = 60, |
| 139 | OP_COPY_NOTIFY = 61, |
| 140 | OP_DEALLOCATE = 62, |
| 141 | OP_IO_ADVISE = 63, |
| 142 | OP_LAYOUTERROR = 64, |
| 143 | OP_LAYOUTSTATS = 65, |
| 144 | OP_OFFLOAD_CANCEL = 66, |
| 145 | OP_OFFLOAD_STATUS = 67, |
| 146 | OP_READ_PLUS = 68, |
| 147 | OP_SEEK = 69, |
| 148 | OP_WRITE_SAME = 70, |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 149 | OP_CLONE = 71, |
Anna Schumaker | 87a15a8 | 2014-09-26 13:58:26 -0400 | [diff] [blame] | 150 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | OP_ILLEGAL = 10044, |
| 152 | }; |
| 153 | |
Shankar Anand | e2b2095 | 2006-07-10 04:45:44 -0700 | [diff] [blame] | 154 | /*Defining first and last NFS4 operations implemented. |
| 155 | Needs to be updated if more operations are defined in future.*/ |
| 156 | |
| 157 | #define FIRST_NFS4_OP OP_ACCESS |
Anna Schumaker | 8217d14 | 2013-10-30 13:38:13 -0400 | [diff] [blame] | 158 | #define LAST_NFS40_OP OP_RELEASE_LOCKOWNER |
| 159 | #define LAST_NFS41_OP OP_RECLAIM_COMPLETE |
Christoph Hellwig | ffa0160 | 2015-12-03 12:59:52 +0100 | [diff] [blame] | 160 | #define LAST_NFS42_OP OP_CLONE |
| 161 | #define LAST_NFS4_OP LAST_NFS42_OP |
Shankar Anand | e2b2095 | 2006-07-10 04:45:44 -0700 | [diff] [blame] | 162 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | enum nfsstat4 { |
| 164 | NFS4_OK = 0, |
| 165 | NFS4ERR_PERM = 1, |
| 166 | NFS4ERR_NOENT = 2, |
| 167 | NFS4ERR_IO = 5, |
| 168 | NFS4ERR_NXIO = 6, |
| 169 | NFS4ERR_ACCESS = 13, |
| 170 | NFS4ERR_EXIST = 17, |
| 171 | NFS4ERR_XDEV = 18, |
| 172 | /* Unused/reserved 19 */ |
| 173 | NFS4ERR_NOTDIR = 20, |
| 174 | NFS4ERR_ISDIR = 21, |
| 175 | NFS4ERR_INVAL = 22, |
| 176 | NFS4ERR_FBIG = 27, |
| 177 | NFS4ERR_NOSPC = 28, |
| 178 | NFS4ERR_ROFS = 30, |
| 179 | NFS4ERR_MLINK = 31, |
| 180 | NFS4ERR_NAMETOOLONG = 63, |
| 181 | NFS4ERR_NOTEMPTY = 66, |
| 182 | NFS4ERR_DQUOT = 69, |
| 183 | NFS4ERR_STALE = 70, |
| 184 | NFS4ERR_BADHANDLE = 10001, |
| 185 | NFS4ERR_BAD_COOKIE = 10003, |
| 186 | NFS4ERR_NOTSUPP = 10004, |
| 187 | NFS4ERR_TOOSMALL = 10005, |
| 188 | NFS4ERR_SERVERFAULT = 10006, |
| 189 | NFS4ERR_BADTYPE = 10007, |
| 190 | NFS4ERR_DELAY = 10008, |
| 191 | NFS4ERR_SAME = 10009, |
| 192 | NFS4ERR_DENIED = 10010, |
| 193 | NFS4ERR_EXPIRED = 10011, |
| 194 | NFS4ERR_LOCKED = 10012, |
| 195 | NFS4ERR_GRACE = 10013, |
| 196 | NFS4ERR_FHEXPIRED = 10014, |
| 197 | NFS4ERR_SHARE_DENIED = 10015, |
| 198 | NFS4ERR_WRONGSEC = 10016, |
| 199 | NFS4ERR_CLID_INUSE = 10017, |
| 200 | NFS4ERR_RESOURCE = 10018, |
| 201 | NFS4ERR_MOVED = 10019, |
| 202 | NFS4ERR_NOFILEHANDLE = 10020, |
| 203 | NFS4ERR_MINOR_VERS_MISMATCH = 10021, |
| 204 | NFS4ERR_STALE_CLIENTID = 10022, |
| 205 | NFS4ERR_STALE_STATEID = 10023, |
| 206 | NFS4ERR_OLD_STATEID = 10024, |
| 207 | NFS4ERR_BAD_STATEID = 10025, |
| 208 | NFS4ERR_BAD_SEQID = 10026, |
| 209 | NFS4ERR_NOT_SAME = 10027, |
| 210 | NFS4ERR_LOCK_RANGE = 10028, |
| 211 | NFS4ERR_SYMLINK = 10029, |
| 212 | NFS4ERR_RESTOREFH = 10030, |
| 213 | NFS4ERR_LEASE_MOVED = 10031, |
| 214 | NFS4ERR_ATTRNOTSUPP = 10032, |
| 215 | NFS4ERR_NO_GRACE = 10033, |
| 216 | NFS4ERR_RECLAIM_BAD = 10034, |
| 217 | NFS4ERR_RECLAIM_CONFLICT = 10035, |
| 218 | NFS4ERR_BADXDR = 10036, |
| 219 | NFS4ERR_LOCKS_HELD = 10037, |
| 220 | NFS4ERR_OPENMODE = 10038, |
| 221 | NFS4ERR_BADOWNER = 10039, |
| 222 | NFS4ERR_BADCHAR = 10040, |
| 223 | NFS4ERR_BADNAME = 10041, |
| 224 | NFS4ERR_BAD_RANGE = 10042, |
| 225 | NFS4ERR_LOCK_NOTSUPP = 10043, |
| 226 | NFS4ERR_OP_ILLEGAL = 10044, |
| 227 | NFS4ERR_DEADLOCK = 10045, |
| 228 | NFS4ERR_FILE_OPEN = 10046, |
| 229 | NFS4ERR_ADMIN_REVOKED = 10047, |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 230 | NFS4ERR_CB_PATH_DOWN = 10048, |
| 231 | |
| 232 | /* nfs41 */ |
| 233 | NFS4ERR_BADIOMODE = 10049, |
| 234 | NFS4ERR_BADLAYOUT = 10050, |
| 235 | NFS4ERR_BAD_SESSION_DIGEST = 10051, |
| 236 | NFS4ERR_BADSESSION = 10052, |
| 237 | NFS4ERR_BADSLOT = 10053, |
| 238 | NFS4ERR_COMPLETE_ALREADY = 10054, |
| 239 | NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055, |
| 240 | NFS4ERR_DELEG_ALREADY_WANTED = 10056, |
| 241 | NFS4ERR_BACK_CHAN_BUSY = 10057, /* backchan reqs outstanding */ |
| 242 | NFS4ERR_LAYOUTTRYLATER = 10058, |
| 243 | NFS4ERR_LAYOUTUNAVAILABLE = 10059, |
| 244 | NFS4ERR_NOMATCHING_LAYOUT = 10060, |
| 245 | NFS4ERR_RECALLCONFLICT = 10061, |
| 246 | NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062, |
| 247 | NFS4ERR_SEQ_MISORDERED = 10063, /* unexpected seq.id in req */ |
| 248 | NFS4ERR_SEQUENCE_POS = 10064, /* [CB_]SEQ. op not 1st op */ |
| 249 | NFS4ERR_REQ_TOO_BIG = 10065, /* request too big */ |
| 250 | NFS4ERR_REP_TOO_BIG = 10066, /* reply too big */ |
| 251 | NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067, /* rep. not all cached */ |
| 252 | NFS4ERR_RETRY_UNCACHED_REP = 10068, /* retry & rep. uncached */ |
| 253 | NFS4ERR_UNSAFE_COMPOUND = 10069, /* retry/recovery too hard */ |
| 254 | NFS4ERR_TOO_MANY_OPS = 10070, /* too many ops in [CB_]COMP */ |
| 255 | NFS4ERR_OP_NOT_IN_SESSION = 10071, /* op needs [CB_]SEQ. op */ |
| 256 | NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */ |
| 257 | /* Error 10073 is unused. */ |
| 258 | NFS4ERR_CLIENTID_BUSY = 10074, /* clientid has state */ |
| 259 | NFS4ERR_PNFS_IO_HOLE = 10075, /* IO to _SPARSE file hole */ |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 260 | NFS4ERR_SEQ_FALSE_RETRY = 10076, /* retry not original */ |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 261 | NFS4ERR_BAD_HIGH_SLOT = 10077, /* sequence arg bad */ |
| 262 | NFS4ERR_DEADSESSION = 10078, /* persistent session dead */ |
| 263 | NFS4ERR_ENCR_ALG_UNSUPP = 10079, /* SSV alg mismatch */ |
| 264 | NFS4ERR_PNFS_NO_LAYOUT = 10080, /* direct I/O with no layout */ |
| 265 | NFS4ERR_NOT_ONLY_OP = 10081, /* bad compound */ |
| 266 | NFS4ERR_WRONG_CRED = 10082, /* permissions:state change */ |
| 267 | NFS4ERR_WRONG_TYPE = 10083, /* current operation mismatch */ |
| 268 | NFS4ERR_DIRDELEG_UNAVAIL = 10084, /* no directory delegation */ |
| 269 | NFS4ERR_REJECT_DELEG = 10085, /* on callback */ |
| 270 | NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */ |
| 271 | NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ |
Steve Dickson | 4488cc9 | 2013-05-02 13:18:55 -0400 | [diff] [blame] | 272 | |
| 273 | /* nfs42 */ |
| 274 | NFS4ERR_PARTNER_NOTSUPP = 10088, |
| 275 | NFS4ERR_PARTNER_NO_AUTH = 10089, |
Anna Schumaker | 2b8941b | 2014-08-27 11:17:56 -0400 | [diff] [blame] | 276 | NFS4ERR_UNION_NOTSUPP = 10090, |
Steve Dickson | 4488cc9 | 2013-05-02 13:18:55 -0400 | [diff] [blame] | 277 | NFS4ERR_OFFLOAD_DENIED = 10091, |
| 278 | NFS4ERR_WRONG_LFS = 10092, |
| 279 | NFS4ERR_BADLABEL = 10093, |
Anna Schumaker | 2b8941b | 2014-08-27 11:17:56 -0400 | [diff] [blame] | 280 | NFS4ERR_OFFLOAD_NO_REQS = 10094, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | }; |
| 282 | |
J. Bruce Fields | a9004ab | 2011-08-23 15:43:04 -0400 | [diff] [blame] | 283 | static inline bool seqid_mutating_err(u32 err) |
| 284 | { |
Chuck Lever | 059aa734 | 2017-01-22 14:04:29 -0500 | [diff] [blame] | 285 | /* See RFC 7530, section 9.1.7 */ |
J. Bruce Fields | a9004ab | 2011-08-23 15:43:04 -0400 | [diff] [blame] | 286 | switch (err) { |
| 287 | case NFS4ERR_STALE_CLIENTID: |
| 288 | case NFS4ERR_STALE_STATEID: |
| 289 | case NFS4ERR_BAD_STATEID: |
| 290 | case NFS4ERR_BAD_SEQID: |
| 291 | case NFS4ERR_BADXDR: |
| 292 | case NFS4ERR_RESOURCE: |
| 293 | case NFS4ERR_NOFILEHANDLE: |
Chuck Lever | 059aa734 | 2017-01-22 14:04:29 -0500 | [diff] [blame] | 294 | case NFS4ERR_MOVED: |
J. Bruce Fields | a9004ab | 2011-08-23 15:43:04 -0400 | [diff] [blame] | 295 | return false; |
| 296 | }; |
| 297 | return true; |
| 298 | } |
| 299 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | /* |
| 301 | * Note: NF4BAD is not actually part of the protocol; it is just used |
| 302 | * internally by nfsd. |
| 303 | */ |
| 304 | enum nfs_ftype4 { |
| 305 | NF4BAD = 0, |
| 306 | NF4REG = 1, /* Regular File */ |
| 307 | NF4DIR = 2, /* Directory */ |
| 308 | NF4BLK = 3, /* Special File - block device */ |
| 309 | NF4CHR = 4, /* Special File - character device */ |
| 310 | NF4LNK = 5, /* Symbolic Link */ |
| 311 | NF4SOCK = 6, /* Special File - socket */ |
| 312 | NF4FIFO = 7, /* Special File - fifo */ |
| 313 | NF4ATTRDIR = 8, /* Attribute Directory */ |
| 314 | NF4NAMEDATTR = 9 /* Named Attribute */ |
| 315 | }; |
| 316 | |
| 317 | enum open_claim_type4 { |
| 318 | NFS4_OPEN_CLAIM_NULL = 0, |
| 319 | NFS4_OPEN_CLAIM_PREVIOUS = 1, |
| 320 | NFS4_OPEN_CLAIM_DELEGATE_CUR = 2, |
J. Bruce Fields | 8b289b2 | 2011-10-19 11:52:12 -0400 | [diff] [blame] | 321 | NFS4_OPEN_CLAIM_DELEGATE_PREV = 3, |
| 322 | NFS4_OPEN_CLAIM_FH = 4, /* 4.1 */ |
| 323 | NFS4_OPEN_CLAIM_DELEG_CUR_FH = 5, /* 4.1 */ |
| 324 | NFS4_OPEN_CLAIM_DELEG_PREV_FH = 6, /* 4.1 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | }; |
| 326 | |
| 327 | enum opentype4 { |
| 328 | NFS4_OPEN_NOCREATE = 0, |
| 329 | NFS4_OPEN_CREATE = 1 |
| 330 | }; |
| 331 | |
| 332 | enum createmode4 { |
| 333 | NFS4_CREATE_UNCHECKED = 0, |
| 334 | NFS4_CREATE_GUARDED = 1, |
Benny Halevy | 79fb54a | 2009-04-03 08:29:17 +0300 | [diff] [blame] | 335 | NFS4_CREATE_EXCLUSIVE = 2, |
| 336 | /* |
| 337 | * New to NFSv4.1. If session is persistent, |
| 338 | * GUARDED4 MUST be used. Otherwise, use |
| 339 | * EXCLUSIVE4_1 instead of EXCLUSIVE4. |
| 340 | */ |
| 341 | NFS4_CREATE_EXCLUSIVE4_1 = 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 342 | }; |
| 343 | |
| 344 | enum limit_by4 { |
| 345 | NFS4_LIMIT_SIZE = 1, |
| 346 | NFS4_LIMIT_BLOCKS = 2 |
| 347 | }; |
| 348 | |
| 349 | enum open_delegation_type4 { |
| 350 | NFS4_OPEN_DELEGATE_NONE = 0, |
| 351 | NFS4_OPEN_DELEGATE_READ = 1, |
Benny Halevy | d24433c | 2012-02-16 20:57:17 +0200 | [diff] [blame] | 352 | NFS4_OPEN_DELEGATE_WRITE = 2, |
| 353 | NFS4_OPEN_DELEGATE_NONE_EXT = 3, /* 4.1 */ |
| 354 | }; |
| 355 | |
| 356 | enum why_no_delegation4 { /* new to v4.1 */ |
| 357 | WND4_NOT_WANTED = 0, |
| 358 | WND4_CONTENTION = 1, |
| 359 | WND4_RESOURCE = 2, |
| 360 | WND4_NOT_SUPP_FTYPE = 3, |
| 361 | WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4, |
| 362 | WND4_NOT_SUPP_UPGRADE = 5, |
| 363 | WND4_NOT_SUPP_DOWNGRADE = 6, |
| 364 | WND4_CANCELLED = 7, |
| 365 | WND4_IS_DIR = 8, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | }; |
| 367 | |
| 368 | enum lock_type4 { |
| 369 | NFS4_UNLOCK_LT = 0, |
| 370 | NFS4_READ_LT = 1, |
| 371 | NFS4_WRITE_LT = 2, |
| 372 | NFS4_READW_LT = 3, |
| 373 | NFS4_WRITEW_LT = 4 |
| 374 | }; |
| 375 | |
| 376 | |
| 377 | /* Mandatory Attributes */ |
| 378 | #define FATTR4_WORD0_SUPPORTED_ATTRS (1UL << 0) |
| 379 | #define FATTR4_WORD0_TYPE (1UL << 1) |
| 380 | #define FATTR4_WORD0_FH_EXPIRE_TYPE (1UL << 2) |
| 381 | #define FATTR4_WORD0_CHANGE (1UL << 3) |
| 382 | #define FATTR4_WORD0_SIZE (1UL << 4) |
| 383 | #define FATTR4_WORD0_LINK_SUPPORT (1UL << 5) |
| 384 | #define FATTR4_WORD0_SYMLINK_SUPPORT (1UL << 6) |
| 385 | #define FATTR4_WORD0_NAMED_ATTR (1UL << 7) |
| 386 | #define FATTR4_WORD0_FSID (1UL << 8) |
| 387 | #define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9) |
| 388 | #define FATTR4_WORD0_LEASE_TIME (1UL << 10) |
| 389 | #define FATTR4_WORD0_RDATTR_ERROR (1UL << 11) |
Benny Halevy | 8c18f20 | 2009-04-03 08:29:14 +0300 | [diff] [blame] | 390 | /* Mandatory in NFSv4.1 */ |
| 391 | #define FATTR4_WORD2_SUPPATTR_EXCLCREAT (1UL << 11) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 392 | |
| 393 | /* Recommended Attributes */ |
| 394 | #define FATTR4_WORD0_ACL (1UL << 12) |
| 395 | #define FATTR4_WORD0_ACLSUPPORT (1UL << 13) |
| 396 | #define FATTR4_WORD0_ARCHIVE (1UL << 14) |
| 397 | #define FATTR4_WORD0_CANSETTIME (1UL << 15) |
| 398 | #define FATTR4_WORD0_CASE_INSENSITIVE (1UL << 16) |
| 399 | #define FATTR4_WORD0_CASE_PRESERVING (1UL << 17) |
| 400 | #define FATTR4_WORD0_CHOWN_RESTRICTED (1UL << 18) |
| 401 | #define FATTR4_WORD0_FILEHANDLE (1UL << 19) |
| 402 | #define FATTR4_WORD0_FILEID (1UL << 20) |
| 403 | #define FATTR4_WORD0_FILES_AVAIL (1UL << 21) |
| 404 | #define FATTR4_WORD0_FILES_FREE (1UL << 22) |
| 405 | #define FATTR4_WORD0_FILES_TOTAL (1UL << 23) |
| 406 | #define FATTR4_WORD0_FS_LOCATIONS (1UL << 24) |
| 407 | #define FATTR4_WORD0_HIDDEN (1UL << 25) |
| 408 | #define FATTR4_WORD0_HOMOGENEOUS (1UL << 26) |
| 409 | #define FATTR4_WORD0_MAXFILESIZE (1UL << 27) |
| 410 | #define FATTR4_WORD0_MAXLINK (1UL << 28) |
| 411 | #define FATTR4_WORD0_MAXNAME (1UL << 29) |
| 412 | #define FATTR4_WORD0_MAXREAD (1UL << 30) |
| 413 | #define FATTR4_WORD0_MAXWRITE (1UL << 31) |
| 414 | #define FATTR4_WORD1_MIMETYPE (1UL << 0) |
| 415 | #define FATTR4_WORD1_MODE (1UL << 1) |
| 416 | #define FATTR4_WORD1_NO_TRUNC (1UL << 2) |
| 417 | #define FATTR4_WORD1_NUMLINKS (1UL << 3) |
| 418 | #define FATTR4_WORD1_OWNER (1UL << 4) |
| 419 | #define FATTR4_WORD1_OWNER_GROUP (1UL << 5) |
| 420 | #define FATTR4_WORD1_QUOTA_HARD (1UL << 6) |
| 421 | #define FATTR4_WORD1_QUOTA_SOFT (1UL << 7) |
| 422 | #define FATTR4_WORD1_QUOTA_USED (1UL << 8) |
| 423 | #define FATTR4_WORD1_RAWDEV (1UL << 9) |
| 424 | #define FATTR4_WORD1_SPACE_AVAIL (1UL << 10) |
| 425 | #define FATTR4_WORD1_SPACE_FREE (1UL << 11) |
| 426 | #define FATTR4_WORD1_SPACE_TOTAL (1UL << 12) |
| 427 | #define FATTR4_WORD1_SPACE_USED (1UL << 13) |
| 428 | #define FATTR4_WORD1_SYSTEM (1UL << 14) |
| 429 | #define FATTR4_WORD1_TIME_ACCESS (1UL << 15) |
| 430 | #define FATTR4_WORD1_TIME_ACCESS_SET (1UL << 16) |
| 431 | #define FATTR4_WORD1_TIME_BACKUP (1UL << 17) |
| 432 | #define FATTR4_WORD1_TIME_CREATE (1UL << 18) |
| 433 | #define FATTR4_WORD1_TIME_DELTA (1UL << 19) |
| 434 | #define FATTR4_WORD1_TIME_METADATA (1UL << 20) |
| 435 | #define FATTR4_WORD1_TIME_MODIFY (1UL << 21) |
| 436 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) |
| 437 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) |
Dean Hildebrand | c772567d | 2010-10-20 00:17:55 -0400 | [diff] [blame] | 438 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) |
Christoph Hellwig | 9cf514c | 2014-05-05 13:11:59 +0200 | [diff] [blame] | 439 | #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) |
Dean Hildebrand | c772567d | 2010-10-20 00:17:55 -0400 | [diff] [blame] | 440 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
Andy Adamson | 88034c3 | 2012-05-23 05:02:34 -0400 | [diff] [blame] | 441 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
Peng Tao | 2a92ee9 | 2015-09-26 02:24:37 +0800 | [diff] [blame] | 442 | #define FATTR4_WORD2_CLONE_BLKSIZE (1UL << 13) |
Trond Myklebust | f3f5a0f | 2013-11-04 14:38:05 -0500 | [diff] [blame] | 443 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) |
Andreas Gruenbacher | dff25dd | 2016-12-02 22:53:30 -0500 | [diff] [blame] | 444 | #define FATTR4_WORD2_MODE_UMASK (1UL << 17) |
Andy Adamson | 88034c3 | 2012-05-23 05:02:34 -0400 | [diff] [blame] | 445 | |
| 446 | /* MDS threshold bitmap bits */ |
| 447 | #define THRESHOLD_RD (1UL << 0) |
| 448 | #define THRESHOLD_WR (1UL << 1) |
| 449 | #define THRESHOLD_RD_IO (1UL << 2) |
| 450 | #define THRESHOLD_WR_IO (1UL << 3) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 451 | |
| 452 | #define NFSPROC4_NULL 0 |
| 453 | #define NFSPROC4_COMPOUND 1 |
Chuck Lever | 764302c | 2009-09-08 19:50:03 -0400 | [diff] [blame] | 454 | #define NFS4_VERSION 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | #define NFS4_MINOR_VERSION 0 |
Mike Sager | 44549df | 2009-04-01 09:21:47 -0400 | [diff] [blame] | 456 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | #define NFS4_DEBUG 1 |
| 458 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 459 | /* Index of predefined Linux client operations */ |
| 460 | |
| 461 | enum { |
| 462 | NFSPROC4_CLNT_NULL = 0, /* Unused */ |
| 463 | NFSPROC4_CLNT_READ, |
| 464 | NFSPROC4_CLNT_WRITE, |
| 465 | NFSPROC4_CLNT_COMMIT, |
| 466 | NFSPROC4_CLNT_OPEN, |
| 467 | NFSPROC4_CLNT_OPEN_CONFIRM, |
| 468 | NFSPROC4_CLNT_OPEN_NOATTR, |
| 469 | NFSPROC4_CLNT_OPEN_DOWNGRADE, |
| 470 | NFSPROC4_CLNT_CLOSE, |
| 471 | NFSPROC4_CLNT_SETATTR, |
| 472 | NFSPROC4_CLNT_FSINFO, |
| 473 | NFSPROC4_CLNT_RENEW, |
| 474 | NFSPROC4_CLNT_SETCLIENTID, |
| 475 | NFSPROC4_CLNT_SETCLIENTID_CONFIRM, |
| 476 | NFSPROC4_CLNT_LOCK, |
| 477 | NFSPROC4_CLNT_LOCKT, |
| 478 | NFSPROC4_CLNT_LOCKU, |
| 479 | NFSPROC4_CLNT_ACCESS, |
| 480 | NFSPROC4_CLNT_GETATTR, |
| 481 | NFSPROC4_CLNT_LOOKUP, |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 482 | NFSPROC4_CLNT_LOOKUPP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 483 | NFSPROC4_CLNT_LOOKUP_ROOT, |
| 484 | NFSPROC4_CLNT_REMOVE, |
| 485 | NFSPROC4_CLNT_RENAME, |
| 486 | NFSPROC4_CLNT_LINK, |
| 487 | NFSPROC4_CLNT_SYMLINK, |
| 488 | NFSPROC4_CLNT_CREATE, |
| 489 | NFSPROC4_CLNT_PATHCONF, |
| 490 | NFSPROC4_CLNT_STATFS, |
| 491 | NFSPROC4_CLNT_READLINK, |
| 492 | NFSPROC4_CLNT_READDIR, |
| 493 | NFSPROC4_CLNT_SERVER_CAPS, |
| 494 | NFSPROC4_CLNT_DELEGRETURN, |
J. Bruce Fields | 029d105 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 495 | NFSPROC4_CLNT_GETACL, |
J. Bruce Fields | 23ec696 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 496 | NFSPROC4_CLNT_SETACL, |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 497 | NFSPROC4_CLNT_FS_LOCATIONS, |
Trond Myklebust | d3c7b7c | 2010-07-01 12:49:01 -0400 | [diff] [blame] | 498 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, |
Bryan Schumaker | 5a5ea0d | 2011-03-24 17:12:29 +0000 | [diff] [blame] | 499 | NFSPROC4_CLNT_SECINFO, |
Chuck Lever | 44c9993 | 2013-10-17 14:13:30 -0400 | [diff] [blame] | 500 | NFSPROC4_CLNT_FSID_PRESENT, |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 501 | |
| 502 | /* nfs41 */ |
| 503 | NFSPROC4_CLNT_EXCHANGE_ID, |
| 504 | NFSPROC4_CLNT_CREATE_SESSION, |
| 505 | NFSPROC4_CLNT_DESTROY_SESSION, |
| 506 | NFSPROC4_CLNT_SEQUENCE, |
| 507 | NFSPROC4_CLNT_GET_LEASE_TIME, |
Ricardo Labiaga | 18019753 | 2009-12-05 16:08:40 -0500 | [diff] [blame] | 508 | NFSPROC4_CLNT_RECLAIM_COMPLETE, |
Andy Adamson | b1f69b7 | 2010-10-20 00:18:03 -0400 | [diff] [blame] | 509 | NFSPROC4_CLNT_LAYOUTGET, |
| 510 | NFSPROC4_CLNT_GETDEVICEINFO, |
Andy Adamson | 863a3c6 | 2011-03-23 13:27:54 +0000 | [diff] [blame] | 511 | NFSPROC4_CLNT_LAYOUTCOMMIT, |
Benny Halevy | cbe8260 | 2011-05-22 19:52:37 +0300 | [diff] [blame] | 512 | NFSPROC4_CLNT_LAYOUTRETURN, |
Bryan Schumaker | fca78d6 | 2011-06-02 14:59:07 -0400 | [diff] [blame] | 513 | NFSPROC4_CLNT_SECINFO_NO_NAME, |
Bryan Schumaker | 7d97479 | 2011-06-02 14:59:08 -0400 | [diff] [blame] | 514 | NFSPROC4_CLNT_TEST_STATEID, |
Bryan Schumaker | 9aeda35 | 2011-06-02 14:59:09 -0400 | [diff] [blame] | 515 | NFSPROC4_CLNT_FREE_STATEID, |
Andy Adamson | 7f11d8d | 2011-07-30 20:52:35 -0400 | [diff] [blame] | 516 | NFSPROC4_CLNT_GETDEVICELIST, |
Trond Myklebust | ad24ecf | 2012-05-25 17:11:42 -0400 | [diff] [blame] | 517 | NFSPROC4_CLNT_BIND_CONN_TO_SESSION, |
Trond Myklebust | 6624553 | 2012-05-25 17:18:09 -0400 | [diff] [blame] | 518 | NFSPROC4_CLNT_DESTROY_CLIENTID, |
Anna Schumaker | 1c6dcbe | 2014-09-26 13:58:48 -0400 | [diff] [blame] | 519 | |
| 520 | /* nfs42 */ |
| 521 | NFSPROC4_CLNT_SEEK, |
Anna Schumaker | f4ac167 | 2014-11-25 13:18:15 -0500 | [diff] [blame] | 522 | NFSPROC4_CLNT_ALLOCATE, |
Anna Schumaker | 624bd5b | 2014-11-25 13:18:16 -0500 | [diff] [blame] | 523 | NFSPROC4_CLNT_DEALLOCATE, |
Trond Myklebust | be3a5d2 | 2015-06-23 19:51:55 +0800 | [diff] [blame] | 524 | NFSPROC4_CLNT_LAYOUTSTATS, |
Peng Tao | 3602277 | 2015-09-26 02:24:34 +0800 | [diff] [blame] | 525 | NFSPROC4_CLNT_CLONE, |
Anna Schumaker | 2e72448 | 2013-05-21 16:53:03 -0400 | [diff] [blame] | 526 | NFSPROC4_CLNT_COPY, |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 527 | }; |
| 528 | |
| 529 | /* nfs41 types */ |
| 530 | struct nfs4_sessionid { |
| 531 | unsigned char data[NFS4_MAX_SESSIONID_LEN]; |
| 532 | }; |
| 533 | |
| 534 | /* Create Session Flags */ |
Mi Jinlong | a62573d | 2011-03-23 17:57:07 +0800 | [diff] [blame] | 535 | #define SESSION4_PERSIST 0x001 |
| 536 | #define SESSION4_BACK_CHAN 0x002 |
| 537 | #define SESSION4_RDMA 0x004 |
| 538 | |
| 539 | #define SESSION4_FLAG_MASK_A 0x007 |
Benny Halevy | 18df188 | 2009-04-03 08:27:36 +0300 | [diff] [blame] | 540 | |
| 541 | enum state_protect_how4 { |
| 542 | SP4_NONE = 0, |
| 543 | SP4_MACH_CRED = 1, |
| 544 | SP4_SSV = 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 545 | }; |
| 546 | |
Dean Hildebrand | c772567d | 2010-10-20 00:17:55 -0400 | [diff] [blame] | 547 | enum pnfs_layouttype { |
| 548 | LAYOUT_NFSV4_1_FILES = 1, |
| 549 | LAYOUT_OSD2_OBJECTS = 2, |
| 550 | LAYOUT_BLOCK_VOLUME = 3, |
Tom Haynes | d67ae82 | 2014-12-11 17:02:04 -0500 | [diff] [blame] | 551 | LAYOUT_FLEX_FILES = 4, |
Christoph Hellwig | 40cf446 | 2016-03-04 20:46:14 +0100 | [diff] [blame] | 552 | LAYOUT_SCSI = 5, |
Christoph Hellwig | 6cae0a4 | 2014-08-16 13:31:51 +0200 | [diff] [blame] | 553 | LAYOUT_TYPE_MAX |
Dean Hildebrand | c772567d | 2010-10-20 00:17:55 -0400 | [diff] [blame] | 554 | }; |
| 555 | |
| 556 | /* used for both layout return and recall */ |
| 557 | enum pnfs_layoutreturn_type { |
| 558 | RETURN_FILE = 1, |
| 559 | RETURN_FSID = 2, |
| 560 | RETURN_ALL = 3 |
| 561 | }; |
| 562 | |
| 563 | enum pnfs_iomode { |
| 564 | IOMODE_READ = 1, |
| 565 | IOMODE_RW = 2, |
| 566 | IOMODE_ANY = 3, |
| 567 | }; |
| 568 | |
| 569 | enum pnfs_notify_deviceid_type4 { |
| 570 | NOTIFY_DEVICEID4_CHANGE = 1 << 1, |
| 571 | NOTIFY_DEVICEID4_DELETE = 1 << 2, |
| 572 | }; |
| 573 | |
Christoph Hellwig | 8bb2897 | 2015-08-17 18:41:01 +0200 | [diff] [blame] | 574 | enum pnfs_block_volume_type { |
| 575 | PNFS_BLOCK_VOLUME_SIMPLE = 0, |
| 576 | PNFS_BLOCK_VOLUME_SLICE = 1, |
| 577 | PNFS_BLOCK_VOLUME_CONCAT = 2, |
| 578 | PNFS_BLOCK_VOLUME_STRIPE = 3, |
Christoph Hellwig | 40cf446 | 2016-03-04 20:46:14 +0100 | [diff] [blame] | 579 | PNFS_BLOCK_VOLUME_SCSI = 4, |
Christoph Hellwig | 8bb2897 | 2015-08-17 18:41:01 +0200 | [diff] [blame] | 580 | }; |
| 581 | |
| 582 | enum pnfs_block_extent_state { |
| 583 | PNFS_BLOCK_READWRITE_DATA = 0, |
| 584 | PNFS_BLOCK_READ_DATA = 1, |
| 585 | PNFS_BLOCK_INVALID_DATA = 2, |
| 586 | PNFS_BLOCK_NONE_DATA = 3, |
| 587 | }; |
| 588 | |
| 589 | /* on the wire size of a block layout extent */ |
| 590 | #define PNFS_BLOCK_EXTENT_SIZE \ |
| 591 | (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE) |
| 592 | |
Christoph Hellwig | 40cf446 | 2016-03-04 20:46:14 +0100 | [diff] [blame] | 593 | /* on the wire size of a scsi commit range */ |
| 594 | #define PNFS_SCSI_RANGE_SIZE \ |
| 595 | (4 * sizeof(__be32)) |
| 596 | |
| 597 | enum scsi_code_set { |
| 598 | PS_CODE_SET_BINARY = 1, |
| 599 | PS_CODE_SET_ASCII = 2, |
| 600 | PS_CODE_SET_UTF8 = 3 |
| 601 | }; |
| 602 | |
| 603 | enum scsi_designator_type { |
| 604 | PS_DESIGNATOR_T10 = 1, |
| 605 | PS_DESIGNATOR_EUI64 = 2, |
| 606 | PS_DESIGNATOR_NAA = 3, |
| 607 | PS_DESIGNATOR_NAME = 8 |
| 608 | }; |
| 609 | |
Dean Hildebrand | c772567d | 2010-10-20 00:17:55 -0400 | [diff] [blame] | 610 | #define NFL4_UFLG_MASK 0x0000003F |
| 611 | #define NFL4_UFLG_DENSE 0x00000001 |
| 612 | #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002 |
| 613 | #define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0 |
| 614 | |
| 615 | /* Encoded in the loh_body field of type layouthint4 */ |
| 616 | enum filelayout_hint_care4 { |
| 617 | NFLH4_CARE_DENSE = NFL4_UFLG_DENSE, |
| 618 | NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS, |
| 619 | NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040, |
| 620 | NFLH4_CARE_STRIPE_COUNT = 0x00000080 |
| 621 | }; |
| 622 | |
| 623 | #define NFS4_DEVICEID4_SIZE 16 |
| 624 | |
| 625 | struct nfs4_deviceid { |
| 626 | char data[NFS4_DEVICEID4_SIZE]; |
| 627 | }; |
| 628 | |
Anna Schumaker | 24bab49 | 2014-09-26 13:58:27 -0400 | [diff] [blame] | 629 | enum data_content4 { |
| 630 | NFS4_CONTENT_DATA = 0, |
| 631 | NFS4_CONTENT_HOLE = 1, |
| 632 | }; |
| 633 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 634 | enum pnfs_update_layout_reason { |
| 635 | PNFS_UPDATE_LAYOUT_UNKNOWN = 0, |
| 636 | PNFS_UPDATE_LAYOUT_NO_PNFS, |
| 637 | PNFS_UPDATE_LAYOUT_RD_ZEROLEN, |
| 638 | PNFS_UPDATE_LAYOUT_MDSTHRESH, |
| 639 | PNFS_UPDATE_LAYOUT_NOMEM, |
| 640 | PNFS_UPDATE_LAYOUT_BULK_RECALL, |
| 641 | PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, |
| 642 | PNFS_UPDATE_LAYOUT_FOUND_CACHED, |
| 643 | PNFS_UPDATE_LAYOUT_RETURN, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 644 | PNFS_UPDATE_LAYOUT_RETRY, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 645 | PNFS_UPDATE_LAYOUT_BLOCKED, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 646 | PNFS_UPDATE_LAYOUT_INVALID_OPEN, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 647 | PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, |
| 648 | }; |
| 649 | |
Andrew Elble | 1adf0c5 | 2016-06-15 12:52:07 -0400 | [diff] [blame] | 650 | #define NFS4_OP_MAP_NUM_LONGS \ |
| 651 | DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long)) |
| 652 | #define NFS4_OP_MAP_NUM_WORDS \ |
| 653 | (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32)) |
| 654 | struct nfs4_op_map { |
| 655 | union { |
| 656 | unsigned long longs[NFS4_OP_MAP_NUM_LONGS]; |
| 657 | u32 words[NFS4_OP_MAP_NUM_WORDS]; |
| 658 | } u; |
| 659 | }; |
| 660 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 661 | #endif |