diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 01:27:36 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:12 -0400 |
commit | 18df1884a872a2cc405a578cfd0d3adc8d227277 (patch) | |
tree | fe6406c9797757d034f63208f3231fa7b7f331cb /include/linux/nfs4.h | |
parent | 2f425878b6a71571341dcd3f9e9d1a6f6355da9c (diff) |
nfs41: common protocol definitions
Define all NFSv4.1 common operation and error code constants.
Note that some of the definitions are used by both the nfs41 client
and the server code. This patch is duplicated in the nfs41 and nfsd41
sessions patchset.
Signed-off-by: Andy Adamson<andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: add exchange id flags]
Signed-off-by: Mike Sager <sager@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[removed server-only hunk changing NFSERR_REPLAY_ME]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: add SEQ4_XX to nfs41-common-protocol]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: generic error code update]
[nfs41: reverse EXCHGID4_INVAL_FLAG_MASK_{A,R}]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'include/linux/nfs4.h')
-rw-r--r-- | include/linux/nfs4.h | 128 |
1 files changed, 127 insertions, 1 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index b912311a56b1..29ed600e193b 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define NFS4_FHSIZE 128 | 21 | #define NFS4_FHSIZE 128 |
22 | #define NFS4_MAXPATHLEN PATH_MAX | 22 | #define NFS4_MAXPATHLEN PATH_MAX |
23 | #define NFS4_MAXNAMLEN NAME_MAX | 23 | #define NFS4_MAXNAMLEN NAME_MAX |
24 | #define NFS4_MAX_SESSIONID_LEN 16 | ||
24 | 25 | ||
25 | #define NFS4_ACCESS_READ 0x0001 | 26 | #define NFS4_ACCESS_READ 0x0001 |
26 | #define NFS4_ACCESS_LOOKUP 0x0002 | 27 | #define NFS4_ACCESS_LOOKUP 0x0002 |
@@ -38,6 +39,7 @@ | |||
38 | #define NFS4_OPEN_RESULT_CONFIRM 0x0002 | 39 | #define NFS4_OPEN_RESULT_CONFIRM 0x0002 |
39 | #define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004 | 40 | #define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004 |
40 | 41 | ||
42 | #define NFS4_SHARE_ACCESS_MASK 0x000F | ||
41 | #define NFS4_SHARE_ACCESS_READ 0x0001 | 43 | #define NFS4_SHARE_ACCESS_READ 0x0001 |
42 | #define NFS4_SHARE_ACCESS_WRITE 0x0002 | 44 | #define NFS4_SHARE_ACCESS_WRITE 0x0002 |
43 | #define NFS4_SHARE_ACCESS_BOTH 0x0003 | 45 | #define NFS4_SHARE_ACCESS_BOTH 0x0003 |
@@ -45,6 +47,19 @@ | |||
45 | #define NFS4_SHARE_DENY_WRITE 0x0002 | 47 | #define NFS4_SHARE_DENY_WRITE 0x0002 |
46 | #define NFS4_SHARE_DENY_BOTH 0x0003 | 48 | #define NFS4_SHARE_DENY_BOTH 0x0003 |
47 | 49 | ||
50 | /* nfs41 */ | ||
51 | #define NFS4_SHARE_WANT_MASK 0xFF00 | ||
52 | #define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000 | ||
53 | #define NFS4_SHARE_WANT_READ_DELEG 0x0100 | ||
54 | #define NFS4_SHARE_WANT_WRITE_DELEG 0x0200 | ||
55 | #define NFS4_SHARE_WANT_ANY_DELEG 0x0300 | ||
56 | #define NFS4_SHARE_WANT_NO_DELEG 0x0400 | ||
57 | #define NFS4_SHARE_WANT_CANCEL 0x0500 | ||
58 | |||
59 | #define NFS4_SHARE_WHEN_MASK 0xF0000 | ||
60 | #define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000 | ||
61 | #define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000 | ||
62 | |||
48 | #define NFS4_SET_TO_SERVER_TIME 0 | 63 | #define NFS4_SET_TO_SERVER_TIME 0 |
49 | #define NFS4_SET_TO_CLIENT_TIME 1 | 64 | #define NFS4_SET_TO_CLIENT_TIME 1 |
50 | 65 | ||
@@ -88,6 +103,31 @@ | |||
88 | #define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 | 103 | #define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 |
89 | #define NFS4_ACE_MASK_ALL 0x001F01FF | 104 | #define NFS4_ACE_MASK_ALL 0x001F01FF |
90 | 105 | ||
106 | #define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001 | ||
107 | #define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002 | ||
108 | #define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000 | ||
109 | #define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000 | ||
110 | #define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000 | ||
111 | #define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000 | ||
112 | #define EXCHGID4_FLAG_CONFIRMED_R 0x80000000 | ||
113 | /* | ||
114 | * Since the validity of these bits depends on whether | ||
115 | * they're set in the argument or response, have separate | ||
116 | * invalid flag masks for arg (_A) and resp (_R). | ||
117 | */ | ||
118 | #define EXCHGID4_FLAG_MASK_A 0x40070003 | ||
119 | #define EXCHGID4_FLAG_MASK_R 0x80070003 | ||
120 | |||
121 | #define SEQ4_STATUS_CB_PATH_DOWN 0x00000001 | ||
122 | #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002 | ||
123 | #define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004 | ||
124 | #define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008 | ||
125 | #define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010 | ||
126 | #define SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020 | ||
127 | #define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 | ||
128 | #define SEQ4_STATUS_LEASE_MOVED 0x00000080 | ||
129 | #define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 | ||
130 | |||
91 | #define NFS4_MAX_UINT64 (~(u64)0) | 131 | #define NFS4_MAX_UINT64 (~(u64)0) |
92 | 132 | ||
93 | enum nfs4_acl_whotype { | 133 | enum nfs4_acl_whotype { |
@@ -154,6 +194,28 @@ enum nfs_opnum4 { | |||
154 | OP_VERIFY = 37, | 194 | OP_VERIFY = 37, |
155 | OP_WRITE = 38, | 195 | OP_WRITE = 38, |
156 | OP_RELEASE_LOCKOWNER = 39, | 196 | OP_RELEASE_LOCKOWNER = 39, |
197 | |||
198 | /* nfs41 */ | ||
199 | OP_BACKCHANNEL_CTL = 40, | ||
200 | OP_BIND_CONN_TO_SESSION = 41, | ||
201 | OP_EXCHANGE_ID = 42, | ||
202 | OP_CREATE_SESSION = 43, | ||
203 | OP_DESTROY_SESSION = 44, | ||
204 | OP_FREE_STATEID = 45, | ||
205 | OP_GET_DIR_DELEGATION = 46, | ||
206 | OP_GETDEVICEINFO = 47, | ||
207 | OP_GETDEVICELIST = 48, | ||
208 | OP_LAYOUTCOMMIT = 49, | ||
209 | OP_LAYOUTGET = 50, | ||
210 | OP_LAYOUTRETURN = 51, | ||
211 | OP_SECINFO_NO_NAME = 52, | ||
212 | OP_SEQUENCE = 53, | ||
213 | OP_SET_SSV = 54, | ||
214 | OP_TEST_STATEID = 55, | ||
215 | OP_WANT_DELEGATION = 56, | ||
216 | OP_DESTROY_CLIENTID = 57, | ||
217 | OP_RECLAIM_COMPLETE = 58, | ||
218 | |||
157 | OP_ILLEGAL = 10044, | 219 | OP_ILLEGAL = 10044, |
158 | }; | 220 | }; |
159 | 221 | ||
@@ -230,7 +292,48 @@ enum nfsstat4 { | |||
230 | NFS4ERR_DEADLOCK = 10045, | 292 | NFS4ERR_DEADLOCK = 10045, |
231 | NFS4ERR_FILE_OPEN = 10046, | 293 | NFS4ERR_FILE_OPEN = 10046, |
232 | NFS4ERR_ADMIN_REVOKED = 10047, | 294 | NFS4ERR_ADMIN_REVOKED = 10047, |
233 | NFS4ERR_CB_PATH_DOWN = 10048 | 295 | NFS4ERR_CB_PATH_DOWN = 10048, |
296 | |||
297 | /* nfs41 */ | ||
298 | NFS4ERR_BADIOMODE = 10049, | ||
299 | NFS4ERR_BADLAYOUT = 10050, | ||
300 | NFS4ERR_BAD_SESSION_DIGEST = 10051, | ||
301 | NFS4ERR_BADSESSION = 10052, | ||
302 | NFS4ERR_BADSLOT = 10053, | ||
303 | NFS4ERR_COMPLETE_ALREADY = 10054, | ||
304 | NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055, | ||
305 | NFS4ERR_DELEG_ALREADY_WANTED = 10056, | ||
306 | NFS4ERR_BACK_CHAN_BUSY = 10057, /* backchan reqs outstanding */ | ||
307 | NFS4ERR_LAYOUTTRYLATER = 10058, | ||
308 | NFS4ERR_LAYOUTUNAVAILABLE = 10059, | ||
309 | NFS4ERR_NOMATCHING_LAYOUT = 10060, | ||
310 | NFS4ERR_RECALLCONFLICT = 10061, | ||
311 | NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062, | ||
312 | NFS4ERR_SEQ_MISORDERED = 10063, /* unexpected seq.id in req */ | ||
313 | NFS4ERR_SEQUENCE_POS = 10064, /* [CB_]SEQ. op not 1st op */ | ||
314 | NFS4ERR_REQ_TOO_BIG = 10065, /* request too big */ | ||
315 | NFS4ERR_REP_TOO_BIG = 10066, /* reply too big */ | ||
316 | NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067, /* rep. not all cached */ | ||
317 | NFS4ERR_RETRY_UNCACHED_REP = 10068, /* retry & rep. uncached */ | ||
318 | NFS4ERR_UNSAFE_COMPOUND = 10069, /* retry/recovery too hard */ | ||
319 | NFS4ERR_TOO_MANY_OPS = 10070, /* too many ops in [CB_]COMP */ | ||
320 | NFS4ERR_OP_NOT_IN_SESSION = 10071, /* op needs [CB_]SEQ. op */ | ||
321 | NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */ | ||
322 | /* Error 10073 is unused. */ | ||
323 | NFS4ERR_CLIENTID_BUSY = 10074, /* clientid has state */ | ||
324 | NFS4ERR_PNFS_IO_HOLE = 10075, /* IO to _SPARSE file hole */ | ||
325 | NFS4ERR_SEQ_FALSE_RETRY = 10076, /* retry not origional */ | ||
326 | NFS4ERR_BAD_HIGH_SLOT = 10077, /* sequence arg bad */ | ||
327 | NFS4ERR_DEADSESSION = 10078, /* persistent session dead */ | ||
328 | NFS4ERR_ENCR_ALG_UNSUPP = 10079, /* SSV alg mismatch */ | ||
329 | NFS4ERR_PNFS_NO_LAYOUT = 10080, /* direct I/O with no layout */ | ||
330 | NFS4ERR_NOT_ONLY_OP = 10081, /* bad compound */ | ||
331 | NFS4ERR_WRONG_CRED = 10082, /* permissions:state change */ | ||
332 | NFS4ERR_WRONG_TYPE = 10083, /* current operation mismatch */ | ||
333 | NFS4ERR_DIRDELEG_UNAVAIL = 10084, /* no directory delegation */ | ||
334 | NFS4ERR_REJECT_DELEG = 10085, /* on callback */ | ||
335 | NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */ | ||
336 | NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ | ||
234 | }; | 337 | }; |
235 | 338 | ||
236 | /* | 339 | /* |
@@ -391,6 +494,29 @@ enum { | |||
391 | NFSPROC4_CLNT_GETACL, | 494 | NFSPROC4_CLNT_GETACL, |
392 | NFSPROC4_CLNT_SETACL, | 495 | NFSPROC4_CLNT_SETACL, |
393 | NFSPROC4_CLNT_FS_LOCATIONS, | 496 | NFSPROC4_CLNT_FS_LOCATIONS, |
497 | |||
498 | /* nfs41 */ | ||
499 | NFSPROC4_CLNT_EXCHANGE_ID, | ||
500 | NFSPROC4_CLNT_CREATE_SESSION, | ||
501 | NFSPROC4_CLNT_DESTROY_SESSION, | ||
502 | NFSPROC4_CLNT_SEQUENCE, | ||
503 | NFSPROC4_CLNT_GET_LEASE_TIME, | ||
504 | }; | ||
505 | |||
506 | /* nfs41 types */ | ||
507 | struct nfs4_sessionid { | ||
508 | unsigned char data[NFS4_MAX_SESSIONID_LEN]; | ||
509 | }; | ||
510 | |||
511 | /* Create Session Flags */ | ||
512 | #define SESSION4_PERSIST 0x001 | ||
513 | #define SESSION4_BACK_CHAN 0x002 | ||
514 | #define SESSION4_RDMA 0x004 | ||
515 | |||
516 | enum state_protect_how4 { | ||
517 | SP4_NONE = 0, | ||
518 | SP4_MACH_CRED = 1, | ||
519 | SP4_SSV = 2 | ||
394 | }; | 520 | }; |
395 | 521 | ||
396 | #endif | 522 | #endif |