Print this page
NEX-6778 NFS kstats leak and cause system to hang
Revert "NEX-4261 Per-client NFS server IOPS, bandwidth, and latency kstats"
This reverts commit 586c3ab1927647487f01c337ddc011c642575a52.
Revert "NEX-5354 Aggregated IOPS, bandwidth, and latency kstats for NFS server"
This reverts commit c91d7614da8618ef48018102b077f60ecbbac8c2.
Revert "NEX-5667 nfssrv_stats_flags does not work for aggregated kstats"
This reverts commit 3dcf42618be7dd5f408c327f429c81e07ca08e74.
Revert "NEX-5750 Time values for aggregated NFS server kstats should be normalized"
This reverts commit 1f4d4f901153b0191027969fa4a8064f9d3b9ee1.
Revert "NEX-5942 Panic in rfs4_minorvers_mismatch() with NFSv4.1 client"
This reverts commit 40766417094a162f5e4cc8786c0fa0a7e5871cd9.
Revert "NEX-5752 NFS server: namespace collision in kstats"
This reverts commit ae81e668db86050da8e483264acb0cce0444a132.
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-4261 Per-client NFS server IOPS, bandwidth, and latency kstats
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-3097 IOPS, bandwidth, and latency kstats for NFS server
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/nfs/nfs4_kprot.h
+++ new/usr/src/uts/common/nfs/nfs4_kprot.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 - * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
23 + * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 25
26 26 /*
27 27 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
28 28 * Use is subject to license terms.
29 29 */
30 30
31 31 #ifndef _NFS4_KPROT_H
32 32 #define _NFS4_KPROT_H
33 33
34 34 /*
35 35 * Kernel specific version.
36 36 * NFS Version 4 protocol definitions. From nfs4_prot.x rev 1.119.
37 37 */
38 38
39 39 #ifdef __cplusplus
40 40 extern "C" {
41 41 #endif
42 42
43 43 #include <rpc/rpc.h>
44 44 #ifdef _KERNEL
45 45 #include <rpc/rpc_rdma.h>
46 46 #endif
47 47 #include <sys/stream.h>
48 48
49 49 #define NFS4_FHSIZE 128
50 50 #define NFS4_VERIFIER_SIZE 8
51 51 #define NFS4_OTHER_SIZE 12
52 52
53 53 /*
54 54 * Reasonable upper bounds to catch badly behaving partners
55 55 */
56 56 #define NFS4_OPAQUE_LIMIT 1024
57 57 #define NFS4_COMPOUND_LIMIT 2048
58 58 #define NFS4_FS_LOCATIONS_LIMIT 65536
59 59 #define NFS4_ACL_LIMIT 65536
60 60 #define NFS4_SECINFO_LIMIT 65536
61 61 #define NFS4_FATTR4_LIMIT 1048576
62 62 #define NFS4_DATA_LIMIT 134217728
63 63
64 64 enum nfs_ftype4 {
65 65 NF4REG = 1,
66 66 NF4DIR = 2,
67 67 NF4BLK = 3,
68 68 NF4CHR = 4,
69 69 NF4LNK = 5,
70 70 NF4SOCK = 6,
71 71 NF4FIFO = 7,
72 72 NF4ATTRDIR = 8,
73 73 NF4NAMEDATTR = 9
74 74 };
75 75 typedef enum nfs_ftype4 nfs_ftype4;
76 76
77 77 enum nfsstat4 {
78 78 NFS4_OK = 0,
79 79 NFS4ERR_PERM = 1,
80 80 NFS4ERR_NOENT = 2,
81 81 NFS4ERR_IO = 5,
82 82 NFS4ERR_NXIO = 6,
83 83 NFS4ERR_ACCESS = 13,
84 84 NFS4ERR_EXIST = 17,
85 85 NFS4ERR_XDEV = 18,
86 86 NFS4ERR_NOTDIR = 20,
87 87 NFS4ERR_ISDIR = 21,
88 88 NFS4ERR_INVAL = 22,
89 89 NFS4ERR_FBIG = 27,
90 90 NFS4ERR_NOSPC = 28,
91 91 NFS4ERR_ROFS = 30,
92 92 NFS4ERR_MLINK = 31,
93 93 NFS4ERR_NAMETOOLONG = 63,
94 94 NFS4ERR_NOTEMPTY = 66,
95 95 NFS4ERR_DQUOT = 69,
96 96 NFS4ERR_STALE = 70,
97 97 NFS4ERR_BADHANDLE = 10001,
98 98 NFS4ERR_BAD_COOKIE = 10003,
99 99 NFS4ERR_NOTSUPP = 10004,
100 100 NFS4ERR_TOOSMALL = 10005,
101 101 NFS4ERR_SERVERFAULT = 10006,
102 102 NFS4ERR_BADTYPE = 10007,
103 103 NFS4ERR_DELAY = 10008,
104 104 NFS4ERR_SAME = 10009,
105 105 NFS4ERR_DENIED = 10010,
106 106 NFS4ERR_EXPIRED = 10011,
107 107 NFS4ERR_LOCKED = 10012,
108 108 NFS4ERR_GRACE = 10013,
109 109 NFS4ERR_FHEXPIRED = 10014,
110 110 NFS4ERR_SHARE_DENIED = 10015,
111 111 NFS4ERR_WRONGSEC = 10016,
112 112 NFS4ERR_CLID_INUSE = 10017,
113 113 NFS4ERR_RESOURCE = 10018,
114 114 NFS4ERR_MOVED = 10019,
115 115 NFS4ERR_NOFILEHANDLE = 10020,
116 116 NFS4ERR_MINOR_VERS_MISMATCH = 10021,
117 117 NFS4ERR_STALE_CLIENTID = 10022,
118 118 NFS4ERR_STALE_STATEID = 10023,
119 119 NFS4ERR_OLD_STATEID = 10024,
120 120 NFS4ERR_BAD_STATEID = 10025,
121 121 NFS4ERR_BAD_SEQID = 10026,
122 122 NFS4ERR_NOT_SAME = 10027,
123 123 NFS4ERR_LOCK_RANGE = 10028,
124 124 NFS4ERR_SYMLINK = 10029,
125 125 NFS4ERR_RESTOREFH = 10030,
126 126 NFS4ERR_LEASE_MOVED = 10031,
127 127 NFS4ERR_ATTRNOTSUPP = 10032,
128 128 NFS4ERR_NO_GRACE = 10033,
129 129 NFS4ERR_RECLAIM_BAD = 10034,
130 130 NFS4ERR_RECLAIM_CONFLICT = 10035,
131 131 NFS4ERR_BADXDR = 10036,
132 132 NFS4ERR_LOCKS_HELD = 10037,
133 133 NFS4ERR_OPENMODE = 10038,
134 134 NFS4ERR_BADOWNER = 10039,
135 135 NFS4ERR_BADCHAR = 10040,
136 136 NFS4ERR_BADNAME = 10041,
137 137 NFS4ERR_BAD_RANGE = 10042,
138 138 NFS4ERR_LOCK_NOTSUPP = 10043,
139 139 NFS4ERR_OP_ILLEGAL = 10044,
140 140 NFS4ERR_DEADLOCK = 10045,
141 141 NFS4ERR_FILE_OPEN = 10046,
142 142 NFS4ERR_ADMIN_REVOKED = 10047,
143 143 NFS4ERR_CB_PATH_DOWN = 10048
144 144 };
145 145 typedef enum nfsstat4 nfsstat4;
146 146
147 147 /*
148 148 * A bitmap can only be 56 bits, treat it as a uint64_t for now
149 149 */
150 150 typedef uint64_t bitmap4;
151 151
152 152 typedef uint64_t offset4;
153 153
154 154 typedef uint32_t count4;
155 155
156 156 typedef uint64_t length4;
157 157
158 158 typedef uint64_t clientid4;
159 159
160 160 typedef uint32_t nfs_lease4;
161 161
162 162 typedef uint32_t seqid4;
163 163
164 164 typedef struct {
165 165 uint_t utf8string_len;
166 166 char *utf8string_val;
167 167 } utf8string;
168 168
169 169 typedef utf8string component4;
170 170
171 171 typedef struct {
172 172 uint_t pathname4_len;
173 173 component4 *pathname4_val;
174 174 } pathname4;
175 175
176 176 typedef uint64_t nfs_lockid4;
177 177
178 178 typedef uint64_t nfs_cookie4;
179 179
180 180 typedef struct {
181 181 uint_t linktext4_len;
182 182 char *linktext4_val;
183 183 } linktext4;
184 184
185 185 typedef utf8string ascii_REQUIRED4;
186 186
187 187 typedef struct {
188 188 uint_t sec_oid4_len;
189 189 char *sec_oid4_val;
190 190 } sec_oid4;
191 191
192 192 typedef uint32_t qop4;
193 193
194 194 typedef uint32_t mode4;
195 195
196 196 typedef uint64_t changeid4;
197 197
198 198 typedef uint64_t verifier4;
199 199
200 200 struct nfstime4 {
201 201 int64_t seconds;
202 202 uint32_t nseconds;
203 203 };
204 204 typedef struct nfstime4 nfstime4;
205 205
206 206 enum time_how4 {
207 207 SET_TO_SERVER_TIME4 = 0,
208 208 SET_TO_CLIENT_TIME4 = 1
209 209 };
210 210 typedef enum time_how4 time_how4;
211 211
212 212 struct settime4 {
213 213 time_how4 set_it;
214 214 nfstime4 time;
215 215 };
216 216 typedef struct settime4 settime4;
217 217
218 218 typedef struct {
219 219 uint_t nfs_fh4_len;
220 220 char *nfs_fh4_val;
221 221 } nfs_fh4;
222 222
223 223 struct fsid4 {
224 224 uint64_t major;
225 225 uint64_t minor;
226 226 };
227 227 typedef struct fsid4 fsid4;
228 228
229 229 struct fs_location4 {
230 230 uint_t server_len;
231 231 utf8string *server_val;
232 232 pathname4 rootpath;
233 233 };
234 234 typedef struct fs_location4 fs_location4;
235 235
236 236 struct fs_locations4 {
237 237 pathname4 fs_root;
238 238 uint_t locations_len;
239 239 fs_location4 *locations_val;
240 240 };
241 241 typedef struct fs_locations4 fs_locations4;
242 242
243 243 /*
244 244 * This structure is declared in nfs4.h
245 245 */
246 246 struct nfs_fsl_info;
247 247
248 248 /*
249 249 * ACL support
250 250 */
251 251
252 252 #define ACL4_SUPPORT_ALLOW_ACL 0x00000001
253 253 #define ACL4_SUPPORT_DENY_ACL 0x00000002
254 254 #define ACL4_SUPPORT_AUDIT_ACL 0x00000004
255 255 #define ACL4_SUPPORT_ALARM_ACL 0x00000008
256 256
257 257 typedef uint32_t acetype4;
258 258 #define ACE4_ACCESS_ALLOWED_ACE_TYPE 0x00000000
259 259 #define ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
260 260 #define ACE4_SYSTEM_AUDIT_ACE_TYPE 0x00000002
261 261 #define ACE4_SYSTEM_ALARM_ACE_TYPE 0x00000003
262 262
263 263 typedef uint32_t aceflag4;
264 264 #define ACE4_FILE_INHERIT_ACE 0x00000001
265 265 #define ACE4_DIRECTORY_INHERIT_ACE 0x00000002
266 266 #define ACE4_NO_PROPAGATE_INHERIT_ACE 0x00000004
267 267 #define ACE4_INHERIT_ONLY_ACE 0x00000008
268 268 #define ACE4_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
269 269 #define ACE4_FAILED_ACCESS_ACE_FLAG 0x00000020
270 270 #define ACE4_IDENTIFIER_GROUP 0x00000040
271 271 /*
272 272 * This defines all valid flag bits, as defined by RFC 7530. If
273 273 * any additional flag bits are deemed part of the NFSv4 spec,
274 274 * you must also add them to the definition below.
275 275 */
276 276 #define ACE4_VALID_FLAG_BITS (\
277 277 ACE4_FILE_INHERIT_ACE | \
278 278 ACE4_DIRECTORY_INHERIT_ACE | \
279 279 ACE4_NO_PROPAGATE_INHERIT_ACE | \
280 280 ACE4_INHERIT_ONLY_ACE | \
281 281 ACE4_SUCCESSFUL_ACCESS_ACE_FLAG | \
282 282 ACE4_FAILED_ACCESS_ACE_FLAG | \
283 283 ACE4_IDENTIFIER_GROUP)
284 284
285 285 typedef uint32_t acemask4;
286 286 #define ACE4_READ_DATA 0x00000001
287 287 #define ACE4_LIST_DIRECTORY 0x00000001
288 288 #define ACE4_WRITE_DATA 0x00000002
289 289 #define ACE4_ADD_FILE 0x00000002
290 290 #define ACE4_APPEND_DATA 0x00000004
291 291 #define ACE4_ADD_SUBDIRECTORY 0x00000004
292 292 #define ACE4_READ_NAMED_ATTRS 0x00000008
293 293 #define ACE4_WRITE_NAMED_ATTRS 0x00000010
294 294 #define ACE4_EXECUTE 0x00000020
295 295 #define ACE4_DELETE_CHILD 0x00000040
296 296 #define ACE4_READ_ATTRIBUTES 0x00000080
297 297 #define ACE4_WRITE_ATTRIBUTES 0x00000100
298 298 #define ACE4_DELETE 0x00010000
299 299 #define ACE4_READ_ACL 0x00020000
300 300 #define ACE4_WRITE_ACL 0x00040000
301 301 #define ACE4_WRITE_OWNER 0x00080000
302 302 #define ACE4_SYNCHRONIZE 0x00100000
303 303 #define ACE4_GENERIC_READ 0x00120081
304 304 #define ACE4_GENERIC_WRITE 0x00160106
305 305 #define ACE4_GENERIC_EXECUTE 0x001200A0
306 306 /*
307 307 * This defines all valid access mask bits, as defined by RFC 7530. If
308 308 * any additional access mask bits are deemed part of the NFSv4 spec,
309 309 * you must also add them to the definition below.
310 310 */
311 311 #define ACE4_VALID_MASK_BITS (\
312 312 ACE4_READ_DATA | \
313 313 ACE4_LIST_DIRECTORY | \
314 314 ACE4_WRITE_DATA | \
315 315 ACE4_ADD_FILE | \
316 316 ACE4_APPEND_DATA | \
317 317 ACE4_ADD_SUBDIRECTORY | \
318 318 ACE4_READ_NAMED_ATTRS | \
319 319 ACE4_WRITE_NAMED_ATTRS | \
320 320 ACE4_EXECUTE | \
321 321 ACE4_DELETE_CHILD | \
322 322 ACE4_READ_ATTRIBUTES | \
323 323 ACE4_WRITE_ATTRIBUTES | \
324 324 ACE4_DELETE | \
325 325 ACE4_READ_ACL | \
326 326 ACE4_WRITE_ACL | \
327 327 ACE4_WRITE_OWNER | \
328 328 ACE4_SYNCHRONIZE)
329 329
330 330 /* Used to signify an undefined value for an acemask4 */
331 331 #define ACE4_MASK_UNDEFINED 0x80000000
332 332
333 333 #define ACE4_WHO_OWNER "OWNER@"
334 334 #define ACE4_WHO_GROUP "GROUP@"
335 335 #define ACE4_WHO_EVERYONE "EVERYONE@"
336 336
337 337 struct nfsace4 {
338 338 acetype4 type;
339 339 aceflag4 flag;
340 340 acemask4 access_mask;
341 341 utf8string who;
342 342 };
343 343 typedef struct nfsace4 nfsace4;
344 344 #define MODE4_SUID 0x800
345 345 #define MODE4_SGID 0x400
346 346 #define MODE4_SVTX 0x200
347 347 #define MODE4_RUSR 0x100
348 348 #define MODE4_WUSR 0x080
349 349 #define MODE4_XUSR 0x040
350 350 #define MODE4_RGRP 0x020
351 351 #define MODE4_WGRP 0x010
352 352 #define MODE4_XGRP 0x008
353 353 #define MODE4_ROTH 0x004
354 354 #define MODE4_WOTH 0x002
355 355 #define MODE4_XOTH 0x001
356 356
357 357 /*
358 358 * ACL conversion helpers
359 359 */
360 360
361 361 typedef enum {
362 362 ace4_unused,
363 363 ace4_user_obj,
364 364 ace4_user,
365 365 ace4_group, /* includes GROUP and GROUP_OBJ */
366 366 ace4_other_obj
367 367 } ace4_to_aent_state_t;
368 368
369 369 typedef struct ace4vals {
370 370 utf8string *key; /* NB: not allocated here; points to existing utf8 */
371 371 avl_node_t avl;
372 372 acemask4 mask;
373 373 acemask4 allowed;
374 374 acemask4 denied;
375 375 int aent_type;
376 376 } ace4vals_t;
377 377
378 378 typedef struct ace4_list {
379 379 ace4vals_t user_obj;
380 380 avl_tree_t user;
381 381 int numusers;
382 382 ace4vals_t group_obj;
383 383 avl_tree_t group;
384 384 int numgroups;
385 385 ace4vals_t other_obj;
386 386 acemask4 acl_mask;
387 387 int hasmask;
388 388 int dfacl_flag;
389 389 ace4_to_aent_state_t state;
390 390 int seen; /* bitmask of all aclent_t a_type values seen */
391 391 } ace4_list_t;
392 392
393 393 struct specdata4 {
394 394 uint32_t specdata1;
395 395 uint32_t specdata2;
396 396 };
397 397 typedef struct specdata4 specdata4;
398 398 #define FH4_PERSISTENT 0x00000000
399 399 #define FH4_NOEXPIRE_WITH_OPEN 0x00000001
400 400 #define FH4_VOLATILE_ANY 0x00000002
401 401 #define FH4_VOL_MIGRATION 0x00000004
402 402 #define FH4_VOL_RENAME 0x00000008
403 403
404 404 typedef bitmap4 fattr4_supported_attrs;
405 405
406 406 typedef nfs_ftype4 fattr4_type;
407 407
408 408 typedef uint32_t fattr4_fh_expire_type;
409 409
410 410 typedef changeid4 fattr4_change;
411 411
412 412 typedef uint64_t fattr4_size;
413 413
414 414 typedef bool_t fattr4_link_support;
415 415
416 416 typedef bool_t fattr4_symlink_support;
417 417
418 418 typedef bool_t fattr4_named_attr;
419 419
420 420 typedef fsid4 fattr4_fsid;
421 421
422 422 typedef bool_t fattr4_unique_handles;
423 423
424 424 typedef nfs_lease4 fattr4_lease_time;
425 425
426 426 typedef nfsstat4 fattr4_rdattr_error;
427 427
428 428 typedef struct {
429 429 uint_t fattr4_acl_len;
430 430 nfsace4 *fattr4_acl_val;
431 431 } fattr4_acl;
432 432
433 433 typedef uint32_t fattr4_aclsupport;
434 434
435 435 typedef bool_t fattr4_archive;
436 436
437 437 typedef bool_t fattr4_cansettime;
438 438
439 439 typedef bool_t fattr4_case_insensitive;
440 440
441 441 typedef bool_t fattr4_case_preserving;
442 442
443 443 typedef bool_t fattr4_chown_restricted;
444 444
445 445 typedef uint64_t fattr4_fileid;
446 446
447 447 typedef uint64_t fattr4_files_avail;
448 448
449 449 typedef nfs_fh4 fattr4_filehandle;
450 450
451 451 typedef uint64_t fattr4_files_free;
452 452
453 453 typedef uint64_t fattr4_files_total;
454 454
455 455 typedef fs_locations4 fattr4_fs_locations;
456 456
457 457 typedef bool_t fattr4_hidden;
458 458
459 459 typedef bool_t fattr4_homogeneous;
460 460
461 461 typedef uint64_t fattr4_maxfilesize;
462 462
463 463 typedef uint32_t fattr4_maxlink;
464 464
465 465 typedef uint32_t fattr4_maxname;
466 466
467 467 typedef uint64_t fattr4_maxread;
468 468
469 469 typedef uint64_t fattr4_maxwrite;
470 470
471 471 typedef ascii_REQUIRED4 fattr4_mimetype;
472 472
473 473 typedef mode4 fattr4_mode;
474 474
475 475 typedef uint64_t fattr4_mounted_on_fileid;
476 476
477 477 typedef bool_t fattr4_no_trunc;
478 478
479 479 typedef uint32_t fattr4_numlinks;
480 480
481 481 typedef utf8string fattr4_owner;
482 482
483 483 typedef utf8string fattr4_owner_group;
484 484
485 485 typedef uint64_t fattr4_quota_avail_hard;
486 486
487 487 typedef uint64_t fattr4_quota_avail_soft;
488 488
489 489 typedef uint64_t fattr4_quota_used;
490 490
491 491 typedef specdata4 fattr4_rawdev;
492 492
493 493 typedef uint64_t fattr4_space_avail;
494 494
495 495 typedef uint64_t fattr4_space_free;
496 496
497 497 typedef uint64_t fattr4_space_total;
498 498
499 499 typedef uint64_t fattr4_space_used;
500 500
501 501 typedef bool_t fattr4_system;
502 502
503 503 typedef nfstime4 fattr4_time_access;
504 504
505 505 typedef settime4 fattr4_time_access_set;
506 506
507 507 typedef nfstime4 fattr4_time_backup;
508 508
509 509 typedef nfstime4 fattr4_time_create;
510 510
511 511 typedef nfstime4 fattr4_time_delta;
512 512
513 513 typedef nfstime4 fattr4_time_metadata;
514 514
515 515 typedef nfstime4 fattr4_time_modify;
516 516
517 517 typedef settime4 fattr4_time_modify_set;
518 518 #define FATTR4_SUPPORTED_ATTRS 0
519 519 #define FATTR4_TYPE 1
520 520 #define FATTR4_FH_EXPIRE_TYPE 2
521 521 #define FATTR4_CHANGE 3
522 522 #define FATTR4_SIZE 4
523 523 #define FATTR4_LINK_SUPPORT 5
524 524 #define FATTR4_SYMLINK_SUPPORT 6
525 525 #define FATTR4_NAMED_ATTR 7
526 526 #define FATTR4_FSID 8
527 527 #define FATTR4_UNIQUE_HANDLES 9
528 528 #define FATTR4_LEASE_TIME 10
529 529 #define FATTR4_RDATTR_ERROR 11
530 530 #define FATTR4_FILEHANDLE 19
531 531 #define FATTR4_ACL 12
532 532 #define FATTR4_ACLSUPPORT 13
533 533 #define FATTR4_ARCHIVE 14
534 534 #define FATTR4_CANSETTIME 15
535 535 #define FATTR4_CASE_INSENSITIVE 16
536 536 #define FATTR4_CASE_PRESERVING 17
537 537 #define FATTR4_CHOWN_RESTRICTED 18
538 538 #define FATTR4_FILEID 20
539 539 #define FATTR4_FILES_AVAIL 21
540 540 #define FATTR4_FILES_FREE 22
541 541 #define FATTR4_FILES_TOTAL 23
542 542 #define FATTR4_FS_LOCATIONS 24
543 543 #define FATTR4_HIDDEN 25
544 544 #define FATTR4_HOMOGENEOUS 26
545 545 #define FATTR4_MAXFILESIZE 27
546 546 #define FATTR4_MAXLINK 28
547 547 #define FATTR4_MAXNAME 29
548 548 #define FATTR4_MAXREAD 30
549 549 #define FATTR4_MAXWRITE 31
550 550 #define FATTR4_MIMETYPE 32
551 551 #define FATTR4_MODE 33
552 552 #define FATTR4_NO_TRUNC 34
553 553 #define FATTR4_NUMLINKS 35
554 554 #define FATTR4_OWNER 36
555 555 #define FATTR4_OWNER_GROUP 37
556 556 #define FATTR4_QUOTA_AVAIL_HARD 38
557 557 #define FATTR4_QUOTA_AVAIL_SOFT 39
558 558 #define FATTR4_QUOTA_USED 40
559 559 #define FATTR4_RAWDEV 41
560 560 #define FATTR4_SPACE_AVAIL 42
561 561 #define FATTR4_SPACE_FREE 43
562 562 #define FATTR4_SPACE_TOTAL 44
563 563 #define FATTR4_SPACE_USED 45
564 564 #define FATTR4_SYSTEM 46
565 565 #define FATTR4_TIME_ACCESS 47
566 566 #define FATTR4_TIME_ACCESS_SET 48
567 567 #define FATTR4_TIME_BACKUP 49
568 568 #define FATTR4_TIME_CREATE 50
569 569 #define FATTR4_TIME_DELTA 51
570 570 #define FATTR4_TIME_METADATA 52
571 571 #define FATTR4_TIME_MODIFY 53
572 572 #define FATTR4_TIME_MODIFY_SET 54
573 573 #define FATTR4_MOUNTED_ON_FILEID 55
574 574
575 575 struct fattr4 {
576 576 bitmap4 attrmask;
577 577 char *attrlist4;
578 578 uint_t attrlist4_len;
579 579 };
580 580 typedef struct fattr4 fattr4;
581 581
582 582 struct change_info4 {
583 583 bool_t atomic;
584 584 changeid4 before;
585 585 changeid4 after;
586 586 };
587 587 typedef struct change_info4 change_info4;
588 588
589 589 struct clientaddr4 {
590 590 char *r_netid;
591 591 char *r_addr;
592 592 };
593 593 typedef struct clientaddr4 clientaddr4;
594 594
595 595 struct cb_client4 {
596 596 uint_t cb_program;
597 597 clientaddr4 cb_location;
598 598 };
599 599 typedef struct cb_client4 cb_client4;
600 600
601 601 struct stateid4 {
602 602 uint32_t seqid;
603 603 char other[NFS4_OTHER_SIZE];
604 604 };
605 605 typedef struct stateid4 stateid4;
606 606
607 607 struct nfs_client_id4 {
608 608 verifier4 verifier;
609 609 uint_t id_len;
610 610 char *id_val;
611 611 struct sockaddr *cl_addr;
612 612 };
613 613 typedef struct nfs_client_id4 nfs_client_id4;
614 614
615 615 struct open_owner4 {
616 616 clientid4 clientid;
617 617 uint_t owner_len;
618 618 char *owner_val;
619 619 };
620 620 typedef struct open_owner4 open_owner4;
621 621
622 622 struct lock_owner4 {
623 623 clientid4 clientid;
624 624 uint_t owner_len;
625 625 char *owner_val;
626 626 };
627 627 typedef struct lock_owner4 lock_owner4;
628 628
629 629 enum nfs_lock_type4 {
630 630 READ_LT = 1,
631 631 WRITE_LT = 2,
632 632 READW_LT = 3,
633 633 WRITEW_LT = 4
634 634 };
635 635 typedef enum nfs_lock_type4 nfs_lock_type4;
636 636 #define ACCESS4_READ 0x00000001
637 637 #define ACCESS4_LOOKUP 0x00000002
638 638 #define ACCESS4_MODIFY 0x00000004
639 639 #define ACCESS4_EXTEND 0x00000008
640 640 #define ACCESS4_DELETE 0x00000010
641 641 #define ACCESS4_EXECUTE 0x00000020
642 642
643 643 struct ACCESS4args {
644 644 uint32_t access;
645 645 };
646 646 typedef struct ACCESS4args ACCESS4args;
647 647
648 648 struct ACCESS4res {
649 649 nfsstat4 status;
650 650 uint32_t supported;
651 651 uint32_t access;
652 652 };
653 653 typedef struct ACCESS4res ACCESS4res;
654 654
655 655 struct CLOSE4args {
656 656 seqid4 seqid;
657 657 stateid4 open_stateid;
658 658 };
659 659 typedef struct CLOSE4args CLOSE4args;
660 660
661 661 struct CLOSE4res {
662 662 nfsstat4 status;
663 663 stateid4 open_stateid;
664 664 };
665 665 typedef struct CLOSE4res CLOSE4res;
666 666
667 667 struct COMMIT4args {
668 668 offset4 offset;
669 669 count4 count;
670 670 };
671 671 typedef struct COMMIT4args COMMIT4args;
672 672
673 673 struct COMMIT4res {
674 674 nfsstat4 status;
675 675 verifier4 writeverf;
676 676 };
677 677 typedef struct COMMIT4res COMMIT4res;
678 678
679 679 struct CREATE4args {
680 680 nfs_ftype4 type;
681 681 union {
682 682 linktext4 linkdata;
683 683 specdata4 devdata;
684 684 } ftype4_u;
685 685 component4 objname;
686 686 fattr4 createattrs;
687 687 };
688 688 typedef struct CREATE4args CREATE4args;
689 689
690 690 struct CREATE4cargs {
691 691 nfs_ftype4 type;
692 692 union {
693 693 char *clinkdata;
694 694 specdata4 devdata;
695 695 } ftype4_u;
696 696 char *cname;
697 697 fattr4 createattrs;
698 698 };
699 699 typedef struct CREATE4cargs CREATE4cargs;
700 700
701 701 struct CREATE4res {
702 702 nfsstat4 status;
703 703 change_info4 cinfo;
704 704 bitmap4 attrset;
705 705 };
706 706 typedef struct CREATE4res CREATE4res;
707 707
708 708 struct DELEGPURGE4args {
709 709 clientid4 clientid;
710 710 };
711 711 typedef struct DELEGPURGE4args DELEGPURGE4args;
712 712
713 713 struct DELEGPURGE4res {
714 714 nfsstat4 status;
715 715 };
716 716 typedef struct DELEGPURGE4res DELEGPURGE4res;
717 717
718 718 struct DELEGRETURN4args {
719 719 stateid4 deleg_stateid;
720 720 };
721 721 typedef struct DELEGRETURN4args DELEGRETURN4args;
722 722
723 723 struct DELEGRETURN4res {
724 724 nfsstat4 status;
725 725 };
726 726 typedef struct DELEGRETURN4res DELEGRETURN4res;
727 727
728 728 struct mntinfo4;
729 729
730 730 struct GETATTR4args {
731 731 bitmap4 attr_request;
732 732 struct mntinfo4 *mi;
733 733 };
734 734 typedef struct GETATTR4args GETATTR4args;
735 735
736 736 struct nfs4_ga_ext_res;
737 737
738 738 struct nfs4_ga_res {
739 739 vattr_t n4g_va;
740 740 unsigned n4g_change_valid:1;
741 741 unsigned n4g_mon_fid_valid:1;
742 742 unsigned n4g_fsid_valid:1;
743 743 uint_t n4g_attrerr;
744 744 uint_t n4g_attrwhy;
745 745 bitmap4 n4g_resbmap;
746 746 fattr4_change n4g_change;
747 747 fattr4_fsid n4g_fsid;
748 748 fattr4_mounted_on_fileid n4g_mon_fid;
749 749 struct nfs4_ga_ext_res *n4g_ext_res;
750 750 vsecattr_t n4g_vsa;
751 751 };
752 752 typedef struct nfs4_ga_res nfs4_ga_res_t;
753 753
754 754 struct GETATTR4res {
755 755 nfsstat4 status;
756 756 fattr4 obj_attributes;
757 757 nfsstat4 ga_status;
758 758 struct nfs4_ga_res ga_res;
759 759 };
760 760 typedef struct GETATTR4res GETATTR4res;
761 761
762 762 struct GETFH4res {
763 763 nfsstat4 status;
764 764 nfs_fh4 object;
765 765 };
766 766 typedef struct GETFH4res GETFH4res;
767 767
768 768 struct LINK4args {
769 769 component4 newname;
770 770 };
771 771 typedef struct LINK4args LINK4args;
772 772
773 773 struct LINK4cargs {
774 774 char *cnewname;
775 775 };
776 776 typedef struct LINK4cargs LINK4cargs;
777 777
778 778 struct LINK4res {
779 779 nfsstat4 status;
780 780 change_info4 cinfo;
781 781 };
782 782 typedef struct LINK4res LINK4res;
783 783
784 784 struct open_to_lock_owner4 {
785 785 seqid4 open_seqid;
786 786 stateid4 open_stateid;
787 787 seqid4 lock_seqid;
788 788 lock_owner4 lock_owner;
789 789 };
790 790 typedef struct open_to_lock_owner4 open_to_lock_owner4;
791 791
792 792 struct exist_lock_owner4 {
793 793 stateid4 lock_stateid;
794 794 seqid4 lock_seqid;
795 795 };
796 796 typedef struct exist_lock_owner4 exist_lock_owner4;
797 797
798 798 struct locker4 {
799 799 bool_t new_lock_owner;
800 800 union {
801 801 open_to_lock_owner4 open_owner;
802 802 exist_lock_owner4 lock_owner;
803 803 } locker4_u;
804 804 };
805 805 typedef struct locker4 locker4;
806 806
807 807 struct LOCK4args {
808 808 nfs_lock_type4 locktype;
809 809 bool_t reclaim;
810 810 offset4 offset;
811 811 length4 length;
812 812 locker4 locker;
813 813 };
814 814 typedef struct LOCK4args LOCK4args;
815 815
816 816 struct LOCK4denied {
817 817 offset4 offset;
818 818 length4 length;
819 819 nfs_lock_type4 locktype;
820 820 lock_owner4 owner;
821 821 };
822 822 typedef struct LOCK4denied LOCK4denied;
823 823
824 824 struct LOCK4res {
825 825 nfsstat4 status;
826 826 union {
827 827 stateid4 lock_stateid;
828 828 LOCK4denied denied;
829 829 } LOCK4res_u;
830 830 };
831 831 typedef struct LOCK4res LOCK4res;
832 832
833 833 struct LOCKT4args {
834 834 nfs_lock_type4 locktype;
835 835 offset4 offset;
836 836 length4 length;
837 837 lock_owner4 owner;
838 838 };
839 839 typedef struct LOCKT4args LOCKT4args;
840 840
841 841 struct LOCKT4res {
842 842 nfsstat4 status;
843 843 LOCK4denied denied;
844 844 };
845 845 typedef struct LOCKT4res LOCKT4res;
846 846
847 847 struct LOCKU4args {
848 848 nfs_lock_type4 locktype;
849 849 seqid4 seqid;
850 850 stateid4 lock_stateid;
851 851 offset4 offset;
852 852 length4 length;
853 853 };
854 854 typedef struct LOCKU4args LOCKU4args;
855 855
856 856 struct LOCKU4res {
857 857 nfsstat4 status;
858 858 stateid4 lock_stateid;
859 859 };
860 860 typedef struct LOCKU4res LOCKU4res;
861 861
862 862 struct LOOKUP4args {
863 863 component4 objname;
864 864 };
865 865 typedef struct LOOKUP4args LOOKUP4args;
866 866
867 867 struct LOOKUP4cargs {
868 868 char *cname;
869 869 };
870 870 typedef struct LOOKUP4cargs LOOKUP4cargs;
871 871
872 872 struct LOOKUP4res {
873 873 nfsstat4 status;
874 874 };
875 875 typedef struct LOOKUP4res LOOKUP4res;
876 876
877 877 struct LOOKUPP4res {
878 878 nfsstat4 status;
879 879 };
880 880 typedef struct LOOKUPP4res LOOKUPP4res;
881 881
882 882 struct NVERIFY4args {
883 883 fattr4 obj_attributes;
884 884 };
885 885 typedef struct NVERIFY4args NVERIFY4args;
886 886
887 887 struct NVERIFY4res {
888 888 nfsstat4 status;
889 889 };
890 890 typedef struct NVERIFY4res NVERIFY4res;
891 891
892 892 enum createmode4 {
893 893 UNCHECKED4 = 0,
894 894 GUARDED4 = 1,
895 895 EXCLUSIVE4 = 2
896 896 };
897 897 typedef enum createmode4 createmode4;
898 898
899 899 enum opentype4 {
900 900 OPEN4_NOCREATE = 0,
901 901 OPEN4_CREATE = 1
902 902 };
903 903 typedef enum opentype4 opentype4;
904 904
905 905 enum limit_by4 {
906 906 NFS_LIMIT_SIZE = 1,
907 907 NFS_LIMIT_BLOCKS = 2
908 908 };
909 909 typedef enum limit_by4 limit_by4;
910 910
911 911 struct nfs_modified_limit4 {
912 912 uint32_t num_blocks;
913 913 uint32_t bytes_per_block;
914 914 };
915 915 typedef struct nfs_modified_limit4 nfs_modified_limit4;
916 916
917 917 struct nfs_space_limit4 {
918 918 limit_by4 limitby;
919 919 union {
920 920 uint64_t filesize;
921 921 nfs_modified_limit4 mod_blocks;
922 922 } nfs_space_limit4_u;
923 923 };
924 924 typedef struct nfs_space_limit4 nfs_space_limit4;
925 925 #define OPEN4_SHARE_ACCESS_READ 0x00000001
926 926 #define OPEN4_SHARE_ACCESS_WRITE 0x00000002
927 927 #define OPEN4_SHARE_ACCESS_BOTH 0x00000003
928 928 #define OPEN4_SHARE_DENY_NONE 0x00000000
929 929 #define OPEN4_SHARE_DENY_READ 0x00000001
930 930 #define OPEN4_SHARE_DENY_WRITE 0x00000002
931 931 #define OPEN4_SHARE_DENY_BOTH 0x00000003
932 932
933 933 enum open_delegation_type4 {
934 934 OPEN_DELEGATE_NONE = 0,
935 935 OPEN_DELEGATE_READ = 1,
936 936 OPEN_DELEGATE_WRITE = 2
937 937 };
938 938 typedef enum open_delegation_type4 open_delegation_type4;
939 939
940 940 enum open_claim_type4 {
941 941 CLAIM_NULL = 0,
942 942 CLAIM_PREVIOUS = 1,
943 943 CLAIM_DELEGATE_CUR = 2,
944 944 CLAIM_DELEGATE_PREV = 3
945 945 };
946 946 typedef enum open_claim_type4 open_claim_type4;
947 947
948 948 struct open_claim_delegate_cur4 {
949 949 stateid4 delegate_stateid;
950 950 component4 file;
951 951 };
952 952 typedef struct open_claim_delegate_cur4 open_claim_delegate_cur4;
953 953
954 954 struct copen_claim_delegate_cur4 {
955 955 stateid4 delegate_stateid;
956 956 char *cfile;
957 957 };
958 958 typedef struct copen_claim_delegate_cur4 copen_claim_delegate_cur4;
959 959
960 960 struct OPEN4args {
961 961 seqid4 seqid;
962 962 uint32_t share_access;
963 963 uint32_t share_deny;
964 964 open_owner4 owner;
965 965 opentype4 opentype;
966 966 createmode4 mode;
967 967 union {
968 968 fattr4 createattrs;
969 969 verifier4 createverf;
970 970 } createhow4_u;
971 971 open_claim_type4 claim;
972 972 union {
973 973 component4 file;
974 974 open_delegation_type4 delegate_type;
975 975 open_claim_delegate_cur4 delegate_cur_info;
976 976 component4 file_delegate_prev;
977 977 } open_claim4_u;
978 978 };
979 979 typedef struct OPEN4args OPEN4args;
980 980
981 981 struct OPEN4cargs {
982 982 seqid4 seqid;
983 983 uint32_t share_access;
984 984 uint32_t share_deny;
985 985 open_owner4 owner;
986 986 opentype4 opentype;
987 987 createmode4 mode;
988 988 union {
989 989 fattr4 createattrs;
990 990 verifier4 createverf;
991 991 } createhow4_u;
992 992 open_claim_type4 claim;
993 993 union {
994 994 char *cfile;
995 995 open_delegation_type4 delegate_type;
996 996 copen_claim_delegate_cur4 delegate_cur_info;
997 997 char *cfile_delegate_prev;
998 998 } open_claim4_u;
999 999 };
1000 1000 typedef struct OPEN4cargs OPEN4cargs;
1001 1001
1002 1002 struct open_read_delegation4 {
1003 1003 stateid4 stateid;
1004 1004 bool_t recall;
1005 1005 nfsace4 permissions;
1006 1006 };
1007 1007 typedef struct open_read_delegation4 open_read_delegation4;
1008 1008
1009 1009 struct open_write_delegation4 {
1010 1010 stateid4 stateid;
1011 1011 bool_t recall;
1012 1012 nfs_space_limit4 space_limit;
1013 1013 nfsace4 permissions;
1014 1014 };
1015 1015 typedef struct open_write_delegation4 open_write_delegation4;
1016 1016
1017 1017 struct open_delegation4 {
1018 1018 open_delegation_type4 delegation_type;
1019 1019 union {
1020 1020 open_read_delegation4 read;
1021 1021 open_write_delegation4 write;
1022 1022 } open_delegation4_u;
1023 1023 };
1024 1024 typedef struct open_delegation4 open_delegation4;
1025 1025 #define OPEN4_RESULT_CONFIRM 0x00000002
1026 1026 #define OPEN4_RESULT_LOCKTYPE_POSIX 0x00000004
1027 1027
1028 1028 struct OPEN4res {
1029 1029 nfsstat4 status;
1030 1030 stateid4 stateid;
1031 1031 change_info4 cinfo;
1032 1032 uint32_t rflags;
1033 1033 bitmap4 attrset;
1034 1034 open_delegation4 delegation;
1035 1035 };
1036 1036 typedef struct OPEN4res OPEN4res;
1037 1037
1038 1038 struct OPENATTR4args {
1039 1039 bool_t createdir;
1040 1040 };
1041 1041 typedef struct OPENATTR4args OPENATTR4args;
1042 1042
1043 1043 struct OPENATTR4res {
1044 1044 nfsstat4 status;
1045 1045 };
1046 1046 typedef struct OPENATTR4res OPENATTR4res;
1047 1047
1048 1048 struct OPEN_CONFIRM4args {
1049 1049 stateid4 open_stateid;
1050 1050 seqid4 seqid;
1051 1051 };
1052 1052 typedef struct OPEN_CONFIRM4args OPEN_CONFIRM4args;
1053 1053
1054 1054 struct OPEN_CONFIRM4res {
1055 1055 nfsstat4 status;
1056 1056 stateid4 open_stateid;
1057 1057 };
1058 1058 typedef struct OPEN_CONFIRM4res OPEN_CONFIRM4res;
1059 1059
1060 1060 struct OPEN_DOWNGRADE4args {
1061 1061 stateid4 open_stateid;
1062 1062 seqid4 seqid;
1063 1063 uint32_t share_access;
1064 1064 uint32_t share_deny;
1065 1065 };
1066 1066 typedef struct OPEN_DOWNGRADE4args OPEN_DOWNGRADE4args;
1067 1067
1068 1068 struct OPEN_DOWNGRADE4res {
1069 1069 nfsstat4 status;
1070 1070 stateid4 open_stateid;
1071 1071 };
1072 1072 typedef struct OPEN_DOWNGRADE4res OPEN_DOWNGRADE4res;
1073 1073
1074 1074 struct PUTFH4args {
1075 1075 nfs_fh4 object;
1076 1076 };
1077 1077 typedef struct PUTFH4args PUTFH4args;
1078 1078
1079 1079 /*
1080 1080 * Client only side PUTFH arguments
1081 1081 * This is really a nfs4_sharedfh_t * but the forward declaration
1082 1082 * is problematic;
1083 1083 */
1084 1084 struct PUTFH4cargs {
1085 1085 void *sfh;
1086 1086 };
1087 1087 typedef struct PUTFH4cargs PUTFH4cargs;
1088 1088
1089 1089 struct PUTFH4res {
1090 1090 nfsstat4 status;
1091 1091 };
1092 1092 typedef struct PUTFH4res PUTFH4res;
1093 1093
1094 1094 struct PUTPUBFH4res {
1095 1095 nfsstat4 status;
1096 1096 };
1097 1097 typedef struct PUTPUBFH4res PUTPUBFH4res;
1098 1098
1099 1099 struct PUTROOTFH4res {
1100 1100 nfsstat4 status;
1101 1101 };
1102 1102 typedef struct PUTROOTFH4res PUTROOTFH4res;
1103 1103
1104 1104 struct READ4args {
1105 1105 stateid4 stateid;
1106 1106 offset4 offset;
1107 1107 count4 count;
1108 1108 /* The following are used for the XDR decode path */
1109 1109 char *res_data_val_alt;
1110 1110 mblk_t *res_mblk;
1111 1111 struct uio *res_uiop;
1112 1112 uint_t res_maxsize;
1113 1113 #ifdef _KERNEL
1114 1114 struct clist *wlist;
1115 1115 CONN *conn;
1116 1116 #endif
1117 1117 };
1118 1118 typedef struct READ4args READ4args;
1119 1119
1120 1120 struct READ4res {
1121 1121 nfsstat4 status;
1122 1122 bool_t eof;
1123 1123 uint_t data_len;
1124 1124 char *data_val;
1125 1125 mblk_t *mblk;
1126 1126 #ifdef _KERNEL
1127 1127 struct clist *wlist;
1128 1128 uint_t wlist_len;
1129 1129 #endif
1130 1130 };
1131 1131 typedef struct READ4res READ4res;
1132 1132
1133 1133 struct rddir4_cache;
1134 1134
1135 1135 struct READDIR4args {
1136 1136 nfs_cookie4 cookie;
1137 1137 verifier4 cookieverf;
1138 1138 count4 dircount;
1139 1139 count4 maxcount;
1140 1140 bitmap4 attr_request;
1141 1141 vnode_t *dvp;
1142 1142 struct mntinfo4 *mi;
1143 1143 cred_t *cr;
1144 1144 struct rddir4_cache *rdc;
1145 1145 hrtime_t t;
1146 1146 };
1147 1147 typedef struct READDIR4args READDIR4args;
1148 1148
1149 1149 struct READDIR4res_clnt {
1150 1150 nfsstat4 status;
1151 1151 verifier4 cookieverf;
1152 1152 bool_t eof;
1153 1153 struct dirent64 *dotp, *dotdotp;
1154 1154 struct rddir4_cache *rdc;
1155 1155 };
1156 1156 typedef struct READDIR4res_clnt READDIR4res_clnt;
1157 1157
1158 1158 struct READDIR4res {
1159 1159 nfsstat4 status;
1160 1160 verifier4 cookieverf;
1161 1161 mblk_t *mblk;
1162 1162 uint_t data_len;
1163 1163 };
1164 1164 typedef struct READDIR4res READDIR4res;
1165 1165
1166 1166 struct READLINK4res {
1167 1167 nfsstat4 status;
1168 1168 linktext4 link;
1169 1169 };
1170 1170 typedef struct READLINK4res READLINK4res;
1171 1171
1172 1172 struct REMOVE4args {
1173 1173 component4 target;
1174 1174 };
1175 1175 typedef struct REMOVE4args REMOVE4args;
1176 1176
1177 1177 struct REMOVE4cargs {
1178 1178 char *ctarget;
1179 1179 };
1180 1180 typedef struct REMOVE4cargs REMOVE4cargs;
1181 1181
1182 1182 struct REMOVE4res {
1183 1183 nfsstat4 status;
1184 1184 change_info4 cinfo;
1185 1185 };
1186 1186 typedef struct REMOVE4res REMOVE4res;
1187 1187
1188 1188 struct RENAME4args {
1189 1189 component4 oldname;
1190 1190 component4 newname;
1191 1191 };
1192 1192 typedef struct RENAME4args RENAME4args;
1193 1193
1194 1194 struct RENAME4cargs {
1195 1195 char *coldname;
1196 1196 char *cnewname;
1197 1197 };
1198 1198 typedef struct RENAME4cargs RENAME4cargs;
1199 1199
1200 1200 struct RENAME4res {
1201 1201 nfsstat4 status;
1202 1202 change_info4 source_cinfo;
1203 1203 change_info4 target_cinfo;
1204 1204 };
1205 1205 typedef struct RENAME4res RENAME4res;
1206 1206
1207 1207 struct RENEW4args {
1208 1208 clientid4 clientid;
1209 1209 };
1210 1210 typedef struct RENEW4args RENEW4args;
1211 1211
1212 1212 struct RENEW4res {
1213 1213 nfsstat4 status;
1214 1214 };
1215 1215 typedef struct RENEW4res RENEW4res;
1216 1216
1217 1217 struct RESTOREFH4res {
1218 1218 nfsstat4 status;
1219 1219 };
1220 1220 typedef struct RESTOREFH4res RESTOREFH4res;
1221 1221
1222 1222 struct SAVEFH4res {
1223 1223 nfsstat4 status;
1224 1224 };
1225 1225 typedef struct SAVEFH4res SAVEFH4res;
1226 1226
1227 1227 struct SECINFO4args {
1228 1228 component4 name;
1229 1229 };
1230 1230 typedef struct SECINFO4args SECINFO4args;
1231 1231
1232 1232 struct SECINFO4cargs {
1233 1233 char *cname;
1234 1234 };
1235 1235 typedef struct SECINFO4cargs SECINFO4cargs;
1236 1236
1237 1237 enum rpc_gss_svc_t {
1238 1238 RPC_GSS_SVC_NONE = 1,
1239 1239 RPC_GSS_SVC_INTEGRITY = 2,
1240 1240 RPC_GSS_SVC_PRIVACY = 3
1241 1241 };
1242 1242 typedef enum rpc_gss_svc_t rpc_gss_svc_t;
1243 1243
1244 1244 struct rpcsec_gss_info {
1245 1245 sec_oid4 oid;
1246 1246 qop4 qop;
1247 1247 rpc_gss_svc_t service;
1248 1248 };
1249 1249 typedef struct rpcsec_gss_info rpcsec_gss_info;
1250 1250
1251 1251 struct secinfo4 {
1252 1252 uint32_t flavor;
1253 1253 rpcsec_gss_info flavor_info;
1254 1254 };
1255 1255 typedef struct secinfo4 secinfo4;
1256 1256
1257 1257 struct SECINFO4res {
1258 1258 nfsstat4 status;
1259 1259 uint_t SECINFO4resok_len;
1260 1260 secinfo4 *SECINFO4resok_val;
1261 1261 };
1262 1262 typedef struct SECINFO4res SECINFO4res;
1263 1263
1264 1264 struct SETATTR4args {
1265 1265 stateid4 stateid;
1266 1266 fattr4 obj_attributes;
1267 1267 };
1268 1268 typedef struct SETATTR4args SETATTR4args;
1269 1269
1270 1270 struct SETATTR4res {
1271 1271 nfsstat4 status;
1272 1272 bitmap4 attrsset;
1273 1273 };
1274 1274 typedef struct SETATTR4res SETATTR4res;
1275 1275
1276 1276 struct SETCLIENTID4args {
1277 1277 nfs_client_id4 client;
1278 1278 cb_client4 callback;
1279 1279 uint32_t callback_ident;
1280 1280 };
1281 1281 typedef struct SETCLIENTID4args SETCLIENTID4args;
1282 1282
1283 1283 struct SETCLIENTID4resok {
1284 1284 clientid4 clientid;
1285 1285 verifier4 setclientid_confirm;
1286 1286 };
1287 1287 typedef struct SETCLIENTID4resok SETCLIENTID4resok;
1288 1288
1289 1289 struct SETCLIENTID4res {
1290 1290 nfsstat4 status;
1291 1291 union {
1292 1292 SETCLIENTID4resok resok4;
1293 1293 clientaddr4 client_using;
1294 1294 } SETCLIENTID4res_u;
1295 1295 };
1296 1296 typedef struct SETCLIENTID4res SETCLIENTID4res;
1297 1297
1298 1298 struct SETCLIENTID_CONFIRM4args {
1299 1299 clientid4 clientid;
1300 1300 verifier4 setclientid_confirm;
1301 1301 };
1302 1302 typedef struct SETCLIENTID_CONFIRM4args SETCLIENTID_CONFIRM4args;
1303 1303
1304 1304 struct SETCLIENTID_CONFIRM4res {
1305 1305 nfsstat4 status;
1306 1306 };
1307 1307 typedef struct SETCLIENTID_CONFIRM4res SETCLIENTID_CONFIRM4res;
1308 1308
1309 1309 struct VERIFY4args {
1310 1310 fattr4 obj_attributes;
1311 1311 };
1312 1312 typedef struct VERIFY4args VERIFY4args;
1313 1313
1314 1314 struct VERIFY4res {
1315 1315 nfsstat4 status;
1316 1316 };
1317 1317 typedef struct VERIFY4res VERIFY4res;
1318 1318
1319 1319 enum stable_how4 {
1320 1320 UNSTABLE4 = 0,
1321 1321 DATA_SYNC4 = 1,
1322 1322 FILE_SYNC4 = 2
1323 1323 };
1324 1324 typedef enum stable_how4 stable_how4;
1325 1325
1326 1326 /*
1327 1327 * mblk doesn't go over the wire. If non-NULL, it points to an mblk chain
1328 1328 * for the write data.
1329 1329 */
1330 1330
1331 1331 struct WRITE4args {
1332 1332 stateid4 stateid;
1333 1333 offset4 offset;
1334 1334 stable_how4 stable;
1335 1335 uint_t data_len;
1336 1336 char *data_val;
1337 1337 mblk_t *mblk;
1338 1338 #ifdef _KERNEL
1339 1339 struct clist *rlist;
1340 1340 CONN *conn;
1341 1341 #endif
1342 1342 };
1343 1343 typedef struct WRITE4args WRITE4args;
1344 1344
1345 1345 struct WRITE4res {
1346 1346 nfsstat4 status;
1347 1347 count4 count;
1348 1348 stable_how4 committed;
1349 1349 verifier4 writeverf;
1350 1350 };
1351 1351 typedef struct WRITE4res WRITE4res;
1352 1352
1353 1353 struct RELEASE_LOCKOWNER4args {
1354 1354 lock_owner4 lock_owner;
1355 1355 };
1356 1356 typedef struct RELEASE_LOCKOWNER4args RELEASE_LOCKOWNER4args;
1357 1357
1358 1358 struct RELEASE_LOCKOWNER4res {
1359 1359 nfsstat4 status;
1360 1360 };
1361 1361 typedef struct RELEASE_LOCKOWNER4res RELEASE_LOCKOWNER4res;
1362 1362
1363 1363 struct ILLEGAL4res {
1364 1364 nfsstat4 status;
1365 1365 };
1366 1366 typedef struct ILLEGAL4res ILLEGAL4res;
1367 1367
1368 1368 enum nfs_opnum4 {
1369 1369 OP_ACCESS = 3,
1370 1370 OP_CLOSE = 4,
1371 1371 OP_COMMIT = 5,
1372 1372 OP_CREATE = 6,
1373 1373 OP_DELEGPURGE = 7,
1374 1374 OP_DELEGRETURN = 8,
1375 1375 OP_GETATTR = 9,
1376 1376 OP_GETFH = 10,
1377 1377 OP_LINK = 11,
1378 1378 OP_LOCK = 12,
1379 1379 OP_LOCKT = 13,
1380 1380 OP_LOCKU = 14,
1381 1381 OP_LOOKUP = 15,
1382 1382 OP_LOOKUPP = 16,
1383 1383 OP_NVERIFY = 17,
1384 1384 OP_OPEN = 18,
1385 1385 OP_OPENATTR = 19,
1386 1386 OP_OPEN_CONFIRM = 20,
1387 1387 OP_OPEN_DOWNGRADE = 21,
1388 1388 OP_PUTFH = 22,
1389 1389 OP_PUTPUBFH = 23,
1390 1390 OP_PUTROOTFH = 24,
1391 1391 OP_READ = 25,
1392 1392 OP_READDIR = 26,
1393 1393 OP_READLINK = 27,
1394 1394 OP_REMOVE = 28,
1395 1395 OP_RENAME = 29,
1396 1396 OP_RENEW = 30,
1397 1397 OP_RESTOREFH = 31,
1398 1398 OP_SAVEFH = 32,
1399 1399 OP_SECINFO = 33,
1400 1400 OP_SETATTR = 34,
1401 1401 OP_SETCLIENTID = 35,
1402 1402 OP_SETCLIENTID_CONFIRM = 36,
1403 1403 OP_VERIFY = 37,
1404 1404 OP_WRITE = 38,
1405 1405 OP_RELEASE_LOCKOWNER = 39,
1406 1406 OP_ILLEGAL = 10044,
1407 1407 /*
1408 1408 * These are internal client pseudo ops that *MUST* never go over the wire
1409 1409 */
1410 1410 #define SUNW_PRIVATE_OP 0x10000000
1411 1411 #define REAL_OP4(op) ((op) & ~SUNW_PRIVATE_OP)
1412 1412 OP_CCREATE = OP_CREATE | SUNW_PRIVATE_OP,
1413 1413 OP_CLINK = OP_LINK | SUNW_PRIVATE_OP,
1414 1414 OP_CLOOKUP = OP_LOOKUP | SUNW_PRIVATE_OP,
1415 1415 OP_COPEN = OP_OPEN | SUNW_PRIVATE_OP,
1416 1416 OP_CPUTFH = OP_PUTFH | SUNW_PRIVATE_OP,
1417 1417 OP_CREMOVE = OP_REMOVE | SUNW_PRIVATE_OP,
1418 1418 OP_CRENAME = OP_RENAME | SUNW_PRIVATE_OP,
1419 1419 OP_CSECINFO = OP_SECINFO | SUNW_PRIVATE_OP
1420 1420 };
1421 1421 typedef enum nfs_opnum4 nfs_opnum4;
1422 1422
1423 1423 struct nfs_argop4 {
1424 1424 nfs_opnum4 argop;
1425 1425 union {
1426 1426 ACCESS4args opaccess;
1427 1427 CLOSE4args opclose;
1428 1428 COMMIT4args opcommit;
1429 1429 CREATE4args opcreate;
1430 1430 CREATE4cargs opccreate;
1431 1431 DELEGPURGE4args opdelegpurge;
1432 1432 DELEGRETURN4args opdelegreturn;
1433 1433 GETATTR4args opgetattr;
1434 1434 LINK4args oplink;
1435 1435 LINK4cargs opclink;
1436 1436 LOCK4args oplock;
1437 1437 LOCKT4args oplockt;
1438 1438 LOCKU4args oplocku;
1439 1439 LOOKUP4args oplookup;
1440 1440 LOOKUP4cargs opclookup;
1441 1441 NVERIFY4args opnverify;
1442 1442 OPEN4args opopen;
1443 1443 OPEN4cargs opcopen;
1444 1444 OPENATTR4args opopenattr;
1445 1445 OPEN_CONFIRM4args opopen_confirm;
1446 1446 OPEN_DOWNGRADE4args opopen_downgrade;
1447 1447 PUTFH4args opputfh;
1448 1448 PUTFH4cargs opcputfh;
1449 1449 READ4args opread;
1450 1450 READDIR4args opreaddir;
1451 1451 REMOVE4args opremove;
1452 1452 REMOVE4cargs opcremove;
1453 1453 RENAME4args oprename;
1454 1454 RENAME4cargs opcrename;
|
↓ open down ↓ |
1421 lines elided |
↑ open up ↑ |
1455 1455 RENEW4args oprenew;
1456 1456 SECINFO4args opsecinfo;
1457 1457 SECINFO4cargs opcsecinfo;
1458 1458 SETATTR4args opsetattr;
1459 1459 SETCLIENTID4args opsetclientid;
1460 1460 SETCLIENTID_CONFIRM4args opsetclientid_confirm;
1461 1461 VERIFY4args opverify;
1462 1462 WRITE4args opwrite;
1463 1463 RELEASE_LOCKOWNER4args oprelease_lockowner;
1464 1464 } nfs_argop4_u;
1465 + size_t opsize; /* the number of bytes occupied by the */
1466 + /* particular operation in the XDR stream */
1467 + /* (set during the decode only) */
1465 1468 };
1466 1469 typedef struct nfs_argop4 nfs_argop4;
1467 1470
1468 1471 struct nfs_resop4 {
1469 1472 nfs_opnum4 resop;
1470 1473 union {
1471 1474 ACCESS4res opaccess;
1472 1475 CLOSE4res opclose;
1473 1476 COMMIT4res opcommit;
1474 1477 CREATE4res opcreate;
1475 1478 DELEGPURGE4res opdelegpurge;
1476 1479 DELEGRETURN4res opdelegreturn;
1477 1480 GETATTR4res opgetattr;
1478 1481 GETFH4res opgetfh;
1479 1482 LINK4res oplink;
1480 1483 LOCK4res oplock;
1481 1484 LOCKT4res oplockt;
1482 1485 LOCKU4res oplocku;
1483 1486 LOOKUP4res oplookup;
1484 1487 LOOKUPP4res oplookupp;
1485 1488 NVERIFY4res opnverify;
1486 1489 OPEN4res opopen;
1487 1490 OPENATTR4res opopenattr;
1488 1491 OPEN_CONFIRM4res opopen_confirm;
1489 1492 OPEN_DOWNGRADE4res opopen_downgrade;
1490 1493 PUTFH4res opputfh;
1491 1494 PUTPUBFH4res opputpubfh;
1492 1495 PUTROOTFH4res opputrootfh;
1493 1496 READ4res opread;
1494 1497 READDIR4res opreaddir;
1495 1498 READDIR4res_clnt opreaddirclnt;
1496 1499 READLINK4res opreadlink;
1497 1500 REMOVE4res opremove;
1498 1501 RENAME4res oprename;
1499 1502 RENEW4res oprenew;
1500 1503 RESTOREFH4res oprestorefh;
|
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
1501 1504 SAVEFH4res opsavefh;
1502 1505 SECINFO4res opsecinfo;
1503 1506 SETATTR4res opsetattr;
1504 1507 SETCLIENTID4res opsetclientid;
1505 1508 SETCLIENTID_CONFIRM4res opsetclientid_confirm;
1506 1509 VERIFY4res opverify;
1507 1510 WRITE4res opwrite;
1508 1511 RELEASE_LOCKOWNER4res oprelease_lockowner;
1509 1512 ILLEGAL4res opillegal;
1510 1513 } nfs_resop4_u;
1514 + size_t opsize; /* the number of bytes occupied by the */
1515 + /* particular operation in the XDR stream */
1516 + /* (set during the encode only) */
1517 + struct exportinfo *exi; /* the exportinfo where the operation should */
1518 + /* be counted in (support for per-exportinfo */
1519 + /* kstats) */
1511 1520 };
1512 1521 typedef struct nfs_resop4 nfs_resop4;
1513 1522
1514 1523 /*
1515 1524 * Fixed size tag string for easy client encoding
1516 1525 */
1517 1526 struct _ctag {
1518 1527 int ct_type;
1519 1528 char *ct_str;
1520 1529 uint32_t ct_tag[3];
1521 1530 };
1522 1531 typedef struct _ctag ctag_t;
1523 1532
1524 1533 /*
1525 1534 * Client-only encode-only version
1526 1535 */
1527 1536 struct COMPOUND4args_clnt {
1528 1537 int ctag;
1529 1538 uint_t array_len;
1530 1539 nfs_argop4 *array;
1531 1540 };
1532 1541 typedef struct COMPOUND4args_clnt COMPOUND4args_clnt;
1533 1542
1534 1543 struct COMPOUND4args {
1535 1544 utf8string tag;
1536 1545 uint32_t minorversion;
1537 1546 uint_t array_len;
1538 1547 nfs_argop4 *array;
1539 1548 };
1540 1549 typedef struct COMPOUND4args COMPOUND4args;
1541 1550
1542 1551 struct COMPOUND4res_clnt {
1543 1552 nfsstat4 status;
1544 1553 uint_t array_len;
1545 1554 uint_t decode_len;
1546 1555 nfs_resop4 *array;
1547 1556 COMPOUND4args_clnt *argsp;
1548 1557 };
1549 1558 typedef struct COMPOUND4res_clnt COMPOUND4res_clnt;
1550 1559
1551 1560 struct COMPOUND4res {
1552 1561 nfsstat4 status;
1553 1562 utf8string tag;
1554 1563 uint_t array_len;
1555 1564 nfs_resop4 *array;
1556 1565 };
1557 1566 typedef struct COMPOUND4res COMPOUND4res;
1558 1567
1559 1568 struct CB_GETATTR4args {
1560 1569 nfs_fh4 fh;
1561 1570 bitmap4 attr_request;
1562 1571 };
1563 1572 typedef struct CB_GETATTR4args CB_GETATTR4args;
1564 1573
1565 1574 struct CB_GETATTR4res {
1566 1575 nfsstat4 status;
1567 1576 fattr4 obj_attributes;
1568 1577 };
1569 1578 typedef struct CB_GETATTR4res CB_GETATTR4res;
1570 1579
1571 1580 struct CB_RECALL4args {
1572 1581 stateid4 stateid;
1573 1582 bool_t truncate;
1574 1583 nfs_fh4 fh;
1575 1584 };
1576 1585 typedef struct CB_RECALL4args CB_RECALL4args;
1577 1586
1578 1587 struct CB_RECALL4res {
1579 1588 nfsstat4 status;
1580 1589 };
1581 1590 typedef struct CB_RECALL4res CB_RECALL4res;
1582 1591
1583 1592 struct CB_ILLEGAL4res {
1584 1593 nfsstat4 status;
1585 1594 };
1586 1595 typedef struct CB_ILLEGAL4res CB_ILLEGAL4res;
1587 1596
1588 1597 enum nfs_cb_opnum4 {
1589 1598 OP_CB_GETATTR = 3,
1590 1599 OP_CB_RECALL = 4,
1591 1600 OP_CB_ILLEGAL = 10044
1592 1601 };
1593 1602 typedef enum nfs_cb_opnum4 nfs_cb_opnum4;
1594 1603
1595 1604 struct nfs_cb_argop4 {
1596 1605 uint_t argop;
1597 1606 union {
1598 1607 CB_GETATTR4args opcbgetattr;
1599 1608 CB_RECALL4args opcbrecall;
1600 1609 } nfs_cb_argop4_u;
1601 1610 };
1602 1611 typedef struct nfs_cb_argop4 nfs_cb_argop4;
1603 1612
1604 1613 struct nfs_cb_resop4 {
1605 1614 uint_t resop;
1606 1615 union {
1607 1616 CB_GETATTR4res opcbgetattr;
1608 1617 CB_RECALL4res opcbrecall;
1609 1618 CB_ILLEGAL4res opcbillegal;
1610 1619 } nfs_cb_resop4_u;
1611 1620 };
1612 1621 typedef struct nfs_cb_resop4 nfs_cb_resop4;
1613 1622
1614 1623 struct CB_COMPOUND4args {
1615 1624 utf8string tag;
1616 1625 uint32_t minorversion;
1617 1626 uint32_t callback_ident;
1618 1627 uint_t array_len;
1619 1628 nfs_cb_argop4 *array;
1620 1629 };
1621 1630 typedef struct CB_COMPOUND4args CB_COMPOUND4args;
1622 1631
1623 1632 struct CB_COMPOUND4res {
1624 1633 nfsstat4 status;
1625 1634 utf8string tag;
1626 1635 uint_t array_len;
1627 1636 nfs_cb_resop4 *array;
1628 1637 };
1629 1638 typedef struct CB_COMPOUND4res CB_COMPOUND4res;
1630 1639
1631 1640 #define NFS4_PROGRAM 100003
1632 1641 #define NFS_V4 4
1633 1642 #define NFSPROC4_NULL 0
1634 1643 #define NFSPROC4_COMPOUND 1
1635 1644
1636 1645 #define NFS4_CALLBACK 0x40000000
1637 1646 #define NFS_CB 1
1638 1647 #define CB_NULL 0
1639 1648 #define CB_COMPOUND 1
1640 1649
1641 1650 extern bool_t xdr_bitmap4(XDR *, bitmap4 *);
1642 1651 extern bool_t xdr_utf8string(XDR *, utf8string *);
1643 1652 extern bool_t xdr_nfs_fh4(XDR *, nfs_fh4 *);
1644 1653 extern bool_t xdr_fattr4_fsid(XDR *, fattr4_fsid *);
1645 1654 extern bool_t xdr_fattr4_acl(XDR *, fattr4_acl *);
1646 1655 extern bool_t xdr_fattr4_fs_locations(XDR *, fattr4_fs_locations *);
1647 1656 extern bool_t xdr_fattr4_rawdev(XDR *, fattr4_rawdev *);
1648 1657 extern bool_t xdr_nfstime4(XDR *, nfstime4 *);
1649 1658 extern bool_t xdr_settime4(XDR *, settime4 *);
1650 1659 extern bool_t xdr_COMPOUND4args_clnt(XDR *, COMPOUND4args_clnt *);
1651 1660 extern bool_t xdr_COMPOUND4args_srv(XDR *, COMPOUND4args *);
1652 1661 extern bool_t xdr_COMPOUND4res_clnt(XDR *, COMPOUND4res_clnt *);
1653 1662 extern bool_t xdr_COMPOUND4res_srv(XDR *, COMPOUND4res *);
1654 1663 extern bool_t xdr_CB_COMPOUND4args_clnt(XDR *, CB_COMPOUND4args *);
1655 1664 extern bool_t xdr_CB_COMPOUND4args_srv(XDR *, CB_COMPOUND4args *);
1656 1665 extern bool_t xdr_CB_COMPOUND4res(XDR *, CB_COMPOUND4res *);
1657 1666
1658 1667 /*
1659 1668 * xdr for referrrals upcall
1660 1669 */
1661 1670 extern bool_t xdr_knetconfig(XDR *, struct knetconfig *);
1662 1671 extern bool_t xdr_nfs_fsl_info(XDR *, struct nfs_fsl_info *);
1663 1672
1664 1673
1665 1674 #ifdef __cplusplus
1666 1675 }
1667 1676 #endif
1668 1677
1669 1678 #endif /* _NFS4_KPROT_H */
|
↓ open down ↓ |
149 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX