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