diff options
Diffstat (limited to 'usr/src/uts/common/os/modconf.c')
-rw-r--r-- | usr/src/uts/common/os/modconf.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/modconf.c b/usr/src/uts/common/os/modconf.c index 2992567207..3e662fac7d 100644 --- a/usr/src/uts/common/os/modconf.c +++ b/usr/src/uts/common/os/modconf.c @@ -55,6 +55,7 @@ #include <ipp/ipp.h> #include <sys/strsubr.h> #include <sys/kcpc.h> +#include <sys/brand.h> #include <sys/cpc_pcbe.h> #include <sys/kstat.h> #include <sys/fs/sdev_node.h> @@ -237,6 +238,16 @@ struct mod_ops mod_pcbeops = { mod_installpcbe, mod_removepcbe, mod_infonull }; +/* + * Brand modules. + */ +static int mod_installbrand(struct modlbrand *, struct modlinkage *); +static int mod_removebrand(struct modlbrand *, struct modlinkage *); + +struct mod_ops mod_brandops = { + mod_installbrand, mod_removebrand, mod_infonull +}; + static struct sysent *mod_getsysent(struct modlinkage *, struct sysent *); static char uninstall_err[] = "Cannot uninstall %s; not installed"; @@ -496,6 +507,23 @@ mod_removepcbe(struct modlpcbe *modl, struct modlinkage *modlp) } /* + * Manage BrandZ modules. + */ +/*ARGSUSED*/ +static int +mod_installbrand(struct modlbrand *modl, struct modlinkage *modlp) +{ + return (brand_register(modl->brand_branddef)); +} + +/*ARGSUSED*/ +static int +mod_removebrand(struct modlbrand *modl, struct modlinkage *modlp) +{ + return (brand_unregister(modl->brand_branddef)); +} + +/* * manage /dev fs modules */ /*ARGSUSED*/ @@ -1075,8 +1103,10 @@ mod_removefs(struct modlfs *modl, struct modlinkage *modlp) return (EBUSY); } - /* XXX - Shouldn't the refcount be sufficient? */ - + /* + * A mounted filesystem could still have vsw_count = 0 + * so we must check whether anyone is actually using our ops + */ if (vfs_opsinuse(&vswp->vsw_vfsops)) { vfs_unrefvfssw(vswp); WUNLOCK_VFSSW(); |