110 mntopts
111 };
112
113 static const char fs_type_name[FSTYPSZ] = "smbfs";
114
115 static vfsdef_t vfw = {
116 VFSDEF_VERSION,
117 (char *)fs_type_name,
118 smbfsinit, /* init routine */
119 VSW_HASPROTO|VSW_NOTZONESAFE, /* flags */
120 &smbfs_mntopts /* mount options table prototype */
121 };
122
123 static struct modlfs modlfs = {
124 &mod_fsops,
125 "SMBFS filesystem",
126 &vfw
127 };
128
129 static struct modlinkage modlinkage = {
130 MODREV_1, (void *)&modlfs, NULL
131 };
132
133 /*
134 * Mutex to protect the following variables:
135 * smbfs_major
136 * smbfs_minor
137 */
138 extern kmutex_t smbfs_minor_lock;
139 extern int smbfs_major;
140 extern int smbfs_minor;
141
142 /*
143 * Prevent unloads while we have mounts
144 */
145 uint32_t smbfs_mountcount;
146
147 /*
148 * smbfs vfs operations.
149 */
150 static int smbfs_mount(vfs_t *, vnode_t *, struct mounta *, cred_t *);
251 {
252 return (mod_info((struct modlinkage *)&modlinkage, modinfop));
253 }
254
255 /*
256 * Initialize the vfs structure
257 */
258
259 int smbfsfstyp;
260 vfsops_t *smbfs_vfsops = NULL;
261
262 static const fs_operation_def_t smbfs_vfsops_template[] = {
263 { VFSNAME_MOUNT, { .vfs_mount = smbfs_mount } },
264 { VFSNAME_UNMOUNT, { .vfs_unmount = smbfs_unmount } },
265 { VFSNAME_ROOT, { .vfs_root = smbfs_root } },
266 { VFSNAME_STATVFS, { .vfs_statvfs = smbfs_statvfs } },
267 { VFSNAME_SYNC, { .vfs_sync = smbfs_sync } },
268 { VFSNAME_VGET, { .error = fs_nosys } },
269 { VFSNAME_MOUNTROOT, { .error = fs_nosys } },
270 { VFSNAME_FREEVFS, { .vfs_freevfs = smbfs_freevfs } },
271 { NULL, NULL }
272 };
273
274 int
275 smbfsinit(int fstyp, char *name)
276 {
277 int error;
278
279 error = vfs_setfsops(fstyp, smbfs_vfsops_template, &smbfs_vfsops);
280 if (error != 0) {
281 zcmn_err(GLOBAL_ZONEID, CE_WARN,
282 "smbfsinit: bad vfs ops template");
283 return (error);
284 }
285
286 error = vn_make_ops(name, smbfs_vnodeops_template, &smbfs_vnodeops);
287 if (error != 0) {
288 (void) vfs_freevfsops_by_type(fstyp);
289 zcmn_err(GLOBAL_ZONEID, CE_WARN,
290 "smbfsinit: bad vnode ops template");
291 return (error);
|
110 mntopts
111 };
112
113 static const char fs_type_name[FSTYPSZ] = "smbfs";
114
115 static vfsdef_t vfw = {
116 VFSDEF_VERSION,
117 (char *)fs_type_name,
118 smbfsinit, /* init routine */
119 VSW_HASPROTO|VSW_NOTZONESAFE, /* flags */
120 &smbfs_mntopts /* mount options table prototype */
121 };
122
123 static struct modlfs modlfs = {
124 &mod_fsops,
125 "SMBFS filesystem",
126 &vfw
127 };
128
129 static struct modlinkage modlinkage = {
130 MODREV_1, { (void *)&modlfs, NULL }
131 };
132
133 /*
134 * Mutex to protect the following variables:
135 * smbfs_major
136 * smbfs_minor
137 */
138 extern kmutex_t smbfs_minor_lock;
139 extern int smbfs_major;
140 extern int smbfs_minor;
141
142 /*
143 * Prevent unloads while we have mounts
144 */
145 uint32_t smbfs_mountcount;
146
147 /*
148 * smbfs vfs operations.
149 */
150 static int smbfs_mount(vfs_t *, vnode_t *, struct mounta *, cred_t *);
251 {
252 return (mod_info((struct modlinkage *)&modlinkage, modinfop));
253 }
254
255 /*
256 * Initialize the vfs structure
257 */
258
259 int smbfsfstyp;
260 vfsops_t *smbfs_vfsops = NULL;
261
262 static const fs_operation_def_t smbfs_vfsops_template[] = {
263 { VFSNAME_MOUNT, { .vfs_mount = smbfs_mount } },
264 { VFSNAME_UNMOUNT, { .vfs_unmount = smbfs_unmount } },
265 { VFSNAME_ROOT, { .vfs_root = smbfs_root } },
266 { VFSNAME_STATVFS, { .vfs_statvfs = smbfs_statvfs } },
267 { VFSNAME_SYNC, { .vfs_sync = smbfs_sync } },
268 { VFSNAME_VGET, { .error = fs_nosys } },
269 { VFSNAME_MOUNTROOT, { .error = fs_nosys } },
270 { VFSNAME_FREEVFS, { .vfs_freevfs = smbfs_freevfs } },
271 { NULL, { NULL } }
272 };
273
274 int
275 smbfsinit(int fstyp, char *name)
276 {
277 int error;
278
279 error = vfs_setfsops(fstyp, smbfs_vfsops_template, &smbfs_vfsops);
280 if (error != 0) {
281 zcmn_err(GLOBAL_ZONEID, CE_WARN,
282 "smbfsinit: bad vfs ops template");
283 return (error);
284 }
285
286 error = vn_make_ops(name, smbfs_vnodeops_template, &smbfs_vnodeops);
287 if (error != 0) {
288 (void) vfs_freevfsops_by_type(fstyp);
289 zcmn_err(GLOBAL_ZONEID, CE_WARN,
290 "smbfsinit: bad vnode ops template");
291 return (error);
|