diff options
author | alfred <alfred@FreeBSD.org> | 2001-02-20 22:07:36 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-02-20 22:07:36 +0000 |
commit | 557b41f4e9ce086047aaffd2325d860ef65cd318 (patch) | |
tree | e1987b9c318439dcaa734051c47e9789c04037eb /sbin/vinum/list.c | |
parent | d616306dacee5c358e9356020d6a0c67c6d0153e (diff) | |
download | FreeBSD-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 'sbin/vinum/list.c')
-rw-r--r-- | sbin/vinum/list.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sbin/vinum/list.c b/sbin/vinum/list.c index 041ec38..81acc93 100644 --- a/sbin/vinum/list.c +++ b/sbin/vinum/list.c @@ -39,7 +39,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: list.c,v 1.25 2000/12/20 03:38:43 grog Exp grog $ + * $Id: list.c,v 1.30 2001/01/14 11:42:19 grog Exp $ * $FreeBSD$ */ @@ -273,7 +273,7 @@ vinum_ld(int argc, char *argv[], char *argv0[]) enum objecttype type; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } if (argc == 0) { @@ -398,7 +398,7 @@ vinum_lv(int argc, char *argv[], char *argv0[]) enum objecttype type; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } if (argc == 0) @@ -565,7 +565,7 @@ vinum_lp(int argc, char *argv[], char *argv0[]) enum objecttype type; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } if (argc == 0) { @@ -768,7 +768,7 @@ vinum_ls(int argc, char *argv[], char *argv0[]) enum objecttype type; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } if (argc == 0) { @@ -793,7 +793,7 @@ void listconfig() { if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } printf("%d drives:\n", vinum_conf.drives_used); @@ -841,12 +841,12 @@ vinum_info(int argc, char *argv[], char *argv0[]) #endif if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } printf("Flags: 0x%x\n", vinum_conf.flags); if (ioctl(superdev, VINUM_MEMINFO, &meminfo) < 0) { - perror("Can't get information"); + vinum_perror("Can't get information"); return; } printf("Total of %d blocks malloced, total memory: %d\nMaximum allocs: %8d, malloc table at 0x%08x\n", @@ -862,7 +862,7 @@ vinum_info(int argc, char *argv[], char *argv0[]) for (i = 0; i < meminfo.mallocs; i++) { malloced.seq = i; if (ioctl(superdev, VINUM_MALLOCINFO, &malloced) < 0) { - perror("Can't get information"); + vinum_perror("Can't get information"); return; } if (!(i & 63)) @@ -881,7 +881,7 @@ vinum_info(int argc, char *argv[], char *argv0[]) for (i = RQINFO_SIZE - 1; i >= 0; i--) { /* go through the request list in order */ *((int *) &rq) = i; if (ioctl(superdev, VINUM_RQINFO, &rq) < 0) { - perror("Can't get information"); + vinum_perror("Can't get information"); return; } /* Compress devminor into something printable. */ @@ -1067,7 +1067,7 @@ printconfig(FILE * of, char *comment) struct drive drive; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } uname(&uname_s); /* get our system name */ @@ -1158,7 +1158,7 @@ list_defective_objects() int heading_needed = 1; if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) { - perror("Can't get vinum config"); + vinum_perror("Can't get vinum config"); return; } for (o = 0; o < vinum_conf.drives_allocated; o++) { @@ -1237,7 +1237,7 @@ vinum_dumpconfig(int argc, char *argv[], char *argv0[]) tokens = 0; /* no tokens yet */ if (getdevs(&statinfo) < 0) { /* find out what devices we have */ - perror("Can't get device list"); + vinum_perror("Can't get device list"); return; } namelist[0] = '\0'; /* start with empty namelist */ |