Add module load/unload entry point hooks and ioctl integration

This commit is contained in:
Brian Behlendorf 2009-01-09 11:21:59 -08:00
parent ed92da1e4e
commit dd50143ea1
1 changed files with 21 additions and 0 deletions

View File

@ -3101,15 +3101,27 @@ static struct dev_ops zfs_dev_ops = {
}; };
static struct modldrv zfs_modldrv = { static struct modldrv zfs_modldrv = {
#ifdef HAVE_SPL
NULL,
#else
&mod_driverops, &mod_driverops,
#endif /* HAVE_SPL */
"ZFS storage pool", "ZFS storage pool",
&zfs_dev_ops &zfs_dev_ops
}; };
static struct modlinkage modlinkage = { static struct modlinkage modlinkage = {
MODREV_1, MODREV_1,
#ifdef HAVE_ZPL
(void *)&zfs_modlfs, (void *)&zfs_modlfs,
#else
NULL,
#endif /* HAVE_ZPL */
(void *)&zfs_modldrv, (void *)&zfs_modldrv,
#ifdef HAVE_SPL
ZFS_MAJOR,
ZFS_MINORS,
#endif /* HAVE_SPL */
NULL NULL
}; };
@ -3172,8 +3184,17 @@ _fini(void)
return (error); return (error);
} }
#ifdef HAVE_SPL
module_init(_init);
module_exit(_fini);
MODULE_AUTHOR("Sun Microsystems, Inc");
MODULE_DESCRIPTION("ZFS");
MODULE_LICENSE("CDDL");
#else
int int
_info(struct modinfo *modinfop) _info(struct modinfo *modinfop)
{ {
return (mod_info(&modlinkage, modinfop)); return (mod_info(&modlinkage, modinfop));
} }
#endif /* HAVE_SPL */