From 7a7d8290f07c6783d8bc0bd989593afcff189e1b Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Tue, 29 Feb 2000 06:07:39 +0000 Subject: [PATCH] Change the startup sequence of the vinum volume from SI_SUB_DRIVERS to SI_SUB_VINUM, thus making it possible for Vinum to access I/O devices and start. Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively. Style fixes: replace NULL with 0 where appropriate. Submitted-by: Charlie Root (yup, that's all I have to go on). Approved-by: jkh --- sys/dev/vinum/vinum.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index b4b4bf089e5d..194ccc402770 100644 --- a/sys/dev/vinum/vinum.c +++ b/sys/dev/vinum/vinum.c @@ -35,6 +35,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * + * $Id: vinum.c,v 1.28 1999/10/12 09:41:20 grog Exp grog $ * $FreeBSD$ */ @@ -42,6 +43,7 @@ #include #include /* for sync(2) */ +#include #ifdef VINUMDEBUG #include int debug = 0; @@ -55,8 +57,8 @@ STATIC struct cdevsw vinum_cdevsw = { vinumopen, vinumclose, physread, physwrite, vinumioctl, seltrue, nommap, vinumstrategy, - "vinum", CDEV_MAJOR, vinumdump, vinumsize, - D_DISK, BDEV_MAJOR + "vinum", VINUM_CDEV_MAJOR, vinumdump, vinumsize, + D_DISK, VINUM_BDEV_MAJOR }; /* Called by main() during pseudo-device attachment. */ @@ -76,8 +78,9 @@ struct _vinum_conf vinum_conf; /* configuration information */ void vinumattach(void *dummy) { + /* modload should prevent multiple loads, so this is worth a panic */ - if ((vinum_conf.flags & VF_LOADED) != NULL) + if ((vinum_conf.flags & VF_LOADED) != 0) panic("vinum: already loaded"); log(LOG_INFO, "vinum: loaded\n"); @@ -115,6 +118,7 @@ vinumattach(void *dummy) bzero(SD, sizeof(struct sd) * INITIAL_SUBDISKS); vinum_conf.subdisks_allocated = INITIAL_SUBDISKS; /* number of sd slots allocated */ vinum_conf.subdisks_used = 0; /* and number in use */ + } /* @@ -169,7 +173,7 @@ free_vinum(int cleardrive) } while ((vinum_conf.flags & (VF_STOPPING | VF_DAEMONOPEN)) == (VF_STOPPING | VF_DAEMONOPEN)) { /* at least one daemon open, we're stopping */ - queue_daemon_request(daemonrq_return, (union daemoninfo) NULL); /* stop the daemon */ + queue_daemon_request(daemonrq_return, (union daemoninfo) 0); /* stop the daemon */ tsleep(&vinumclose, PUSER, "vstop", 1); /* and wait for it */ } if (SD != NULL) @@ -249,7 +253,7 @@ moduledata_t vinum_mod = (modeventhand_t) vinum_modevent, 0 }; -DECLARE_MODULE(vinum, vinum_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +DECLARE_MODULE(vinum, vinum_mod, SI_SUB_VINUM, SI_ORDER_MIDDLE); /* ARGSUSED */ /* Open a vinum object */ @@ -465,6 +469,7 @@ vinumdump(dev_t dev) /* Not implemented. */ return ENXIO; } + /* Local Variables: */ /* fill-column: 50 */ /* End: */