diff options
author | grog <grog@FreeBSD.org> | 1999-03-13 07:22:00 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-03-13 07:22:00 +0000 |
commit | 1f397a853d56a9a5217a0f2cc562334f2eeb5223 (patch) | |
tree | e2e37df079c2089bf60629ab3c375b3ce4dea7d3 /sys/dev/vinum/vinum.c | |
parent | 0fab88504102c6cda0a5b325fdff6bc17ce211a8 (diff) | |
download | FreeBSD-src-1f397a853d56a9a5217a0f2cc562334f2eeb5223.zip FreeBSD-src-1f397a853d56a9a5217a0f2cc562334f2eeb5223.tar.gz |
vinum_inactive: distinguish whether we care whether the config
is open or not.
Diffstat (limited to 'sys/dev/vinum/vinum.c')
-rw-r--r-- | sys/dev/vinum/vinum.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index 273a0d1..01a2a9c 100644 --- a/sys/dev/vinum/vinum.c +++ b/sys/dev/vinum/vinum.c @@ -145,16 +145,19 @@ vinumattach(void *dummy) } /* - * Check if we have anything open. If so, return 0 (not inactive), - * otherwise 1 (inactive) + * Check if we have anything open. If confopen is != 0, + * that goes for the super device as well, otherwise + * only for volumes. + * + * Return 0 if not inactive, 1 if inactive. */ int -vinum_inactive(void) +vinum_inactive(int confopen) { int i; int can_do = 1; /* assume we can do it */ - if (vinum_conf.flags & VF_OPEN) /* open by vinum(8)? */ + if (confopen && (vinum_conf.flags & VF_OPEN)) /* open by vinum(8)? */ return 0; /* can't do it while we're open */ lock_config(); for (i = 0; i < vinum_conf.volumes_used; i++) { @@ -223,7 +226,7 @@ vinum_modevent(module_t mod, modeventtype_t type, void *unused) vinumattach(NULL); return 0; /* OK */ case MOD_UNLOAD: - if (!vinum_inactive()) /* is anything open? */ + if (!vinum_inactive(1)) /* is anything open? */ return EBUSY; /* yes, we can't do it */ vinum_conf.flags |= VF_STOPPING; /* note that we want to stop */ sync(curproc, &dummyarg); /* write out buffers */ |