138 int, cred_t *, zone_t *);
139
140 /*
141 * Initialize the vfs structure
142 */
143
144 int nfsfstyp;
145 vfsops_t *nfs_vfsops;
146
147 /*
148 * Debug variable to check for rdma based
149 * transport startup and cleanup. Controlled
150 * through /etc/system. Off by default.
151 */
152 int rdma_debug = 0;
153
154 int
155 nfsinit(int fstyp, char *name)
156 {
157 static const fs_operation_def_t nfs_vfsops_template[] = {
158 VFSNAME_MOUNT, { .vfs_mount = nfs_mount },
159 VFSNAME_UNMOUNT, { .vfs_unmount = nfs_unmount },
160 VFSNAME_ROOT, { .vfs_root = nfs_root },
161 VFSNAME_STATVFS, { .vfs_statvfs = nfs_statvfs },
162 VFSNAME_SYNC, { .vfs_sync = nfs_sync },
163 VFSNAME_VGET, { .vfs_vget = nfs_vget },
164 VFSNAME_MOUNTROOT, { .vfs_mountroot = nfs_mountroot },
165 VFSNAME_FREEVFS, { .vfs_freevfs = nfs_freevfs },
166 NULL, NULL
167 };
168 int error;
169
170 error = vfs_setfsops(fstyp, nfs_vfsops_template, &nfs_vfsops);
171 if (error != 0) {
172 zcmn_err(GLOBAL_ZONEID, CE_WARN,
173 "nfsinit: bad vfs ops template");
174 return (error);
175 }
176
177 error = vn_make_ops(name, nfs_vnodeops_template, &nfs_vnodeops);
178 if (error != 0) {
179 (void) vfs_freevfsops_by_type(fstyp);
180 zcmn_err(GLOBAL_ZONEID, CE_WARN,
181 "nfsinit: bad vnode ops template");
182 return (error);
183 }
184
185
186 nfsfstyp = fstyp;
|
138 int, cred_t *, zone_t *);
139
140 /*
141 * Initialize the vfs structure
142 */
143
144 int nfsfstyp;
145 vfsops_t *nfs_vfsops;
146
147 /*
148 * Debug variable to check for rdma based
149 * transport startup and cleanup. Controlled
150 * through /etc/system. Off by default.
151 */
152 int rdma_debug = 0;
153
154 int
155 nfsinit(int fstyp, char *name)
156 {
157 static const fs_operation_def_t nfs_vfsops_template[] = {
158 { VFSNAME_MOUNT, { .vfs_mount = nfs_mount } },
159 { VFSNAME_UNMOUNT, { .vfs_unmount = nfs_unmount } },
160 { VFSNAME_ROOT, { .vfs_root = nfs_root } },
161 { VFSNAME_STATVFS, { .vfs_statvfs = nfs_statvfs } },
162 { VFSNAME_SYNC, { .vfs_sync = nfs_sync } },
163 { VFSNAME_VGET, { .vfs_vget = nfs_vget } },
164 { VFSNAME_MOUNTROOT, { .vfs_mountroot = nfs_mountroot } },
165 { VFSNAME_FREEVFS, { .vfs_freevfs = nfs_freevfs } },
166 { NULL, { NULL } }
167 };
168 int error;
169
170 error = vfs_setfsops(fstyp, nfs_vfsops_template, &nfs_vfsops);
171 if (error != 0) {
172 zcmn_err(GLOBAL_ZONEID, CE_WARN,
173 "nfsinit: bad vfs ops template");
174 return (error);
175 }
176
177 error = vn_make_ops(name, nfs_vnodeops_template, &nfs_vnodeops);
178 if (error != 0) {
179 (void) vfs_freevfsops_by_type(fstyp);
180 zcmn_err(GLOBAL_ZONEID, CE_WARN,
181 "nfsinit: bad vnode ops template");
182 return (error);
183 }
184
185
186 nfsfstyp = fstyp;
|