summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-02-20 22:07:36 +0000
committeralfred <alfred@FreeBSD.org>2001-02-20 22:07:36 +0000
commit557b41f4e9ce086047aaffd2325d860ef65cd318 (patch)
treee1987b9c318439dcaa734051c47e9789c04037eb /sys/dev/vinum
parentd616306dacee5c358e9356020d6a0c67c6d0153e (diff)
downloadFreeBSD-src-557b41f4e9ce086047aaffd2325d860ef65cd318.zip
FreeBSD-src-557b41f4e9ce086047aaffd2325d860ef65cd318.tar.gz
Fix vinum for both devfs and non-devfs systems.
userland tool: Use the vfs.devfs.generation sysctl to test for devfs presense (thanks phk!) when devfs is active it will not try to create the device nodes in /dev and therefore will not complain about the failure to do so. Revert the change in the #define for VINUM_DIR in the kernel header so that vinum can find its device nodes. Replace perror() with vinum_perror() to print file/line when DEVBUG is defined (not defined by default). kernel: Don't use the #define names for the "superdev" creation since they will be prepended by "/dev/" (based on VINUM_DIR), instead use string constants. Create both debug and non-debug "superdev" nodes in the devfs. Problem noticed and fix tested by: Martin Blapp <mblapp@fuchur.lan.attic.ch>
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinum.c13
-rw-r--r--sys/dev/vinum/vinumvar.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index ea4f7d2..1c639f6 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -70,6 +70,7 @@ struct _vinum_conf vinum_conf; /* configuration information */
dev_t vinum_daemon_dev;
dev_t vinum_super_dev;
+dev_t vinum_debug_super_dev;
/*
* Called by main() during pseudo-device attachment. All we need
@@ -91,10 +92,15 @@ vinumattach(void *dummy)
dqend = NULL;
cdevsw_add(&vinum_cdevsw); /* add the cdevsw entry */
+
vinum_daemon_dev = make_dev(&vinum_cdevsw, VINUM_DAEMON_DEV,
- UID_ROOT, GID_WHEEL, S_IRUSR|S_IWUSR, VINUM_DAEMON_DEV_NAME); /* daemon device */
- vinum_super_dev = make_dev(&vinum_cdevsw, VINUM_SUPERDEV,
- UID_ROOT, GID_WHEEL, S_IRUSR|S_IWUSR, VINUM_SUPERDEV_NAME); /* daemon device */
+ UID_ROOT, GID_WHEEL, S_IRUSR|S_IWUSR, "vinum/controld");
+ vinum_debug_super_dev = make_dev(&vinum_cdevsw,
+ VINUMMINOR (1, 0, 0, VINUM_SUPERDEV_TYPE),
+ UID_ROOT, GID_WHEEL, S_IRUSR|S_IWUSR, "vinum/Control");
+ vinum_super_dev = make_dev(&vinum_cdevsw,
+ VINUMMINOR (2, 0, 0, VINUM_SUPERDEV_TYPE),
+ UID_ROOT, GID_WHEEL, S_IRUSR|S_IWUSR, "vinum/control");
/* allocate space: drives... */
DRIVE = (struct drive *) Malloc(sizeof(struct drive) * INITIAL_DRIVES);
@@ -257,6 +263,7 @@ vinum_modevent(module_t mod, modeventtype_t type, void *unused)
#endif
destroy_dev(vinum_daemon_dev); /* daemon device */
destroy_dev(vinum_super_dev);
+ destroy_dev(vinum_debug_super_dev);
cdevsw_remove(&vinum_cdevsw);
log(LOG_INFO, "vinum: unloaded\n"); /* tell the world */
return 0;
diff --git a/sys/dev/vinum/vinumvar.h b/sys/dev/vinum/vinumvar.h
index 9e61128..44a9c8b 100644
--- a/sys/dev/vinum/vinumvar.h
+++ b/sys/dev/vinum/vinumvar.h
@@ -216,7 +216,7 @@ struct devcode {
unsigned signbit:1; /* to make 32 bits */
};
-#define VINUM_DIR "vinum"
+#define VINUM_DIR "/dev/vinum"
/*
* These definitions help catch
OpenPOWER on IntegriCloud