64
65 /*
66 * The devfs_clean_key is taken during a devfs_clean operation: it is used to
67 * prevent unnecessary code execution and for detection of potential deadlocks.
68 */
69 uint_t devfs_clean_key;
70
71 struct dv_node *dvroot;
72
73 /* prototype memory vattrs */
74 vattr_t dv_vattr_dir = {
75 AT_TYPE|AT_MODE|AT_UID|AT_GID, /* va_mask */
76 VDIR, /* va_type */
77 DV_DIRMODE_DEFAULT, /* va_mode */
78 DV_UID_DEFAULT, /* va_uid */
79 DV_GID_DEFAULT, /* va_gid */
80 0, /* va_fsid; */
81 0, /* va_nodeid; */
82 0, /* va_nlink; */
83 0, /* va_size; */
84 0, /* va_atime; */
85 0, /* va_mtime; */
86 0, /* va_ctime; */
87 0, /* va_rdev; */
88 0, /* va_blksize; */
89 0, /* va_nblocks; */
90 0, /* va_seq; */
91 };
92
93 vattr_t dv_vattr_file = {
94 AT_TYPE|AT_MODE|AT_SIZE|AT_UID|AT_GID|AT_RDEV, /* va_mask */
95 0, /* va_type */
96 DV_DEVMODE_DEFAULT, /* va_mode */
97 DV_UID_DEFAULT, /* va_uid */
98 DV_GID_DEFAULT, /* va_gid */
99 0, /* va_fsid; */
100 0, /* va_nodeid; */
101 0, /* va_nlink; */
102 0, /* va_size; */
103 0, /* va_atime; */
104 0, /* va_mtime; */
105 0, /* va_ctime; */
106 0, /* va_rdev; */
107 0, /* va_blksize; */
108 0, /* va_nblocks; */
109 0, /* va_seq; */
110 };
111
112 vattr_t dv_vattr_priv = {
113 AT_TYPE|AT_MODE|AT_SIZE|AT_UID|AT_GID|AT_RDEV, /* va_mask */
114 0, /* va_type */
115 DV_DEVMODE_PRIV, /* va_mode */
116 DV_UID_DEFAULT, /* va_uid */
117 DV_GID_DEFAULT, /* va_gid */
118 0, /* va_fsid; */
119 0, /* va_nodeid; */
120 0, /* va_nlink; */
121 0, /* va_size; */
122 0, /* va_atime; */
123 0, /* va_mtime; */
124 0, /* va_ctime; */
125 0, /* va_rdev; */
126 0, /* va_blksize; */
127 0, /* va_nblocks; */
128 0, /* va_seq; */
129 };
130
131 extern dev_info_t *clone_dip;
132 extern major_t clone_major;
133 extern struct dev_ops *ddi_hold_driver(major_t);
134
135 /* dv_node node constructor for kmem cache */
136 static int
137 i_dv_node_ctor(void *buf, void *cfarg, int flag)
138 {
139 _NOTE(ARGUNUSED(cfarg, flag))
140 struct dv_node *dv = (struct dv_node *)buf;
141 struct vnode *vp;
142
143 bzero(buf, sizeof (struct dv_node));
144 vp = dv->dv_vnode = vn_alloc(flag);
|
64
65 /*
66 * The devfs_clean_key is taken during a devfs_clean operation: it is used to
67 * prevent unnecessary code execution and for detection of potential deadlocks.
68 */
69 uint_t devfs_clean_key;
70
71 struct dv_node *dvroot;
72
73 /* prototype memory vattrs */
74 vattr_t dv_vattr_dir = {
75 AT_TYPE|AT_MODE|AT_UID|AT_GID, /* va_mask */
76 VDIR, /* va_type */
77 DV_DIRMODE_DEFAULT, /* va_mode */
78 DV_UID_DEFAULT, /* va_uid */
79 DV_GID_DEFAULT, /* va_gid */
80 0, /* va_fsid; */
81 0, /* va_nodeid; */
82 0, /* va_nlink; */
83 0, /* va_size; */
84 {0}, /* va_atime; */
85 {0}, /* va_mtime; */
86 {0}, /* va_ctime; */
87 0, /* va_rdev; */
88 0, /* va_blksize; */
89 0, /* va_nblocks; */
90 0, /* va_seq; */
91 };
92
93 vattr_t dv_vattr_file = {
94 AT_TYPE|AT_MODE|AT_SIZE|AT_UID|AT_GID|AT_RDEV, /* va_mask */
95 0, /* va_type */
96 DV_DEVMODE_DEFAULT, /* va_mode */
97 DV_UID_DEFAULT, /* va_uid */
98 DV_GID_DEFAULT, /* va_gid */
99 0, /* va_fsid; */
100 0, /* va_nodeid; */
101 0, /* va_nlink; */
102 0, /* va_size; */
103 {0}, /* va_atime; */
104 {0}, /* va_mtime; */
105 {0}, /* va_ctime; */
106 0, /* va_rdev; */
107 0, /* va_blksize; */
108 0, /* va_nblocks; */
109 0, /* va_seq; */
110 };
111
112 vattr_t dv_vattr_priv = {
113 AT_TYPE|AT_MODE|AT_SIZE|AT_UID|AT_GID|AT_RDEV, /* va_mask */
114 0, /* va_type */
115 DV_DEVMODE_PRIV, /* va_mode */
116 DV_UID_DEFAULT, /* va_uid */
117 DV_GID_DEFAULT, /* va_gid */
118 0, /* va_fsid; */
119 0, /* va_nodeid; */
120 0, /* va_nlink; */
121 0, /* va_size; */
122 {0}, /* va_atime; */
123 {0}, /* va_mtime; */
124 {0}, /* va_ctime; */
125 0, /* va_rdev; */
126 0, /* va_blksize; */
127 0, /* va_nblocks; */
128 0, /* va_seq; */
129 };
130
131 extern dev_info_t *clone_dip;
132 extern major_t clone_major;
133 extern struct dev_ops *ddi_hold_driver(major_t);
134
135 /* dv_node node constructor for kmem cache */
136 static int
137 i_dv_node_ctor(void *buf, void *cfarg, int flag)
138 {
139 _NOTE(ARGUNUSED(cfarg, flag))
140 struct dv_node *dv = (struct dv_node *)buf;
141 struct vnode *vp;
142
143 bzero(buf, sizeof (struct dv_node));
144 vp = dv->dv_vnode = vn_alloc(flag);
|