21
22 /*
23 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2016 Jason King.
26 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
31
32 #ifndef _NFS_EXPORT_H
33 #define _NFS_EXPORT_H
34
35 #include <nfs/nfs_sec.h>
36 #include <nfs/auth.h>
37 #include <sys/vnode.h>
38 #include <nfs/nfs4.h>
39 #include <sys/kiconv.h>
40 #include <sys/avl.h>
41
42 #ifdef _KERNEL
43 #include <sys/pkp_hash.h> /* for PKP_HASH_SIZE */
44 #endif /* _KERNEL */
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 /*
51 * nfs pseudo flavor number is owned by IANA. Need to make sure the
52 * Solaris specific NFS_FLAVOR_NOMAP number will not overlap with any
53 * new IANA defined pseudo flavor numbers. The chance for the overlap
54 * is very small since the growth of new flavor numbers is expected
55 * to be limited.
56 */
57 #define NFS_FLAVOR_NOMAP 999999 /* no nfs flavor mapping */
58
59 /*
60 * As duplicate flavors can be passed into exportfs in the arguments, we
455 * +===+ (VROOT) +---+ +---+
456 *
457 *
458 * Bi-directional interconnect:
459 * treenode_t::tree_exi --------- exportinfo_t::exi_tree
460 * One-way direction connection:
461 * treenode_t::tree_vis .........> exp_visible_t
462 */
463 /* Access to treenode_t is under protection of exported_lock RW_LOCK */
464 typedef struct treenode {
465 /* support for generic n-ary trees */
466 struct treenode *tree_parent;
467 struct treenode *tree_child_first;
468 struct treenode *tree_sibling; /* next sibling */
469 /* private, nfs specific part */
470 struct exportinfo *tree_exi;
471 struct exp_visible *tree_vis;
472 } treenode_t;
473
474 /*
475 * TREE_ROOT checks if the node corresponds to a filesystem root
476 * TREE_EXPORTED checks if the node is explicitly shared
477 */
478
479 #define TREE_ROOT(t) \
480 ((t)->tree_exi && (t)->tree_exi->exi_vp->v_flag & VROOT)
481
482 #define TREE_EXPORTED(t) \
483 ((t)->tree_exi && !PSEUDO((t)->tree_exi))
484
485 #define EXPTABLESIZE 256
486
487 struct exp_hash {
488 struct exportinfo *prev; /* ptr to the previous exportinfo */
489 struct exportinfo *next; /* ptr to the next exportinfo */
490 struct exportinfo **bckt; /* backpointer to the hash bucket */
491 };
492
493 /*
494 * A node associated with an export entry on the
495 * list of exported filesystems.
496 *
497 * exi_count+exi_lock protects an individual exportinfo from being freed
498 * when in use.
499 *
500 * You must have the writer lock on exported_lock to add/delete an exportinfo
|
21
22 /*
23 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2016 Jason King.
26 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
31
32 #ifndef _NFS_EXPORT_H
33 #define _NFS_EXPORT_H
34
35 #include <nfs/nfs_sec.h>
36 #include <nfs/auth.h>
37 #include <sys/vnode.h>
38 #include <nfs/nfs4.h>
39 #include <sys/kiconv.h>
40 #include <sys/avl.h>
41 #include <sys/zone.h>
42
43 #ifdef _KERNEL
44 #include <sys/pkp_hash.h> /* for PKP_HASH_SIZE */
45 #endif /* _KERNEL */
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /*
52 * nfs pseudo flavor number is owned by IANA. Need to make sure the
53 * Solaris specific NFS_FLAVOR_NOMAP number will not overlap with any
54 * new IANA defined pseudo flavor numbers. The chance for the overlap
55 * is very small since the growth of new flavor numbers is expected
56 * to be limited.
57 */
58 #define NFS_FLAVOR_NOMAP 999999 /* no nfs flavor mapping */
59
60 /*
61 * As duplicate flavors can be passed into exportfs in the arguments, we
456 * +===+ (VROOT) +---+ +---+
457 *
458 *
459 * Bi-directional interconnect:
460 * treenode_t::tree_exi --------- exportinfo_t::exi_tree
461 * One-way direction connection:
462 * treenode_t::tree_vis .........> exp_visible_t
463 */
464 /* Access to treenode_t is under protection of exported_lock RW_LOCK */
465 typedef struct treenode {
466 /* support for generic n-ary trees */
467 struct treenode *tree_parent;
468 struct treenode *tree_child_first;
469 struct treenode *tree_sibling; /* next sibling */
470 /* private, nfs specific part */
471 struct exportinfo *tree_exi;
472 struct exp_visible *tree_vis;
473 } treenode_t;
474
475 /*
476 * TREE_ROOT checks if the node corresponds to a filesystem root or
477 * the zone's root directory.
478 * TREE_EXPORTED checks if the node is explicitly shared
479 */
480
481 #define TREE_ROOT(t) \
482 ((t)->tree_exi != NULL && \
483 (((t)->tree_exi->exi_vp->v_flag & VROOT) || \
484 VN_IS_CURZONEROOT((t)->tree_exi->exi_vp)))
485
486 #define TREE_EXPORTED(t) \
487 ((t)->tree_exi && !PSEUDO((t)->tree_exi))
488
489 #define EXPTABLESIZE 256
490
491 struct exp_hash {
492 struct exportinfo *prev; /* ptr to the previous exportinfo */
493 struct exportinfo *next; /* ptr to the next exportinfo */
494 struct exportinfo **bckt; /* backpointer to the hash bucket */
495 };
496
497 /*
498 * A node associated with an export entry on the
499 * list of exported filesystems.
500 *
501 * exi_count+exi_lock protects an individual exportinfo from being freed
502 * when in use.
503 *
504 * You must have the writer lock on exported_lock to add/delete an exportinfo
|