summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>1999-08-07 08:05:46 +0000
committergrog <grog@FreeBSD.org>1999-08-07 08:05:46 +0000
commit0b90cf6a6e2e31ad814b9a36b36b1419f3681440 (patch)
tree310e792378cb2a0fb6bd7b275d754761f244fe7e /sys
parent34ea895440f9e3c37cec9b51e0a48eebb0c6ffb6 (diff)
downloadFreeBSD-src-0b90cf6a6e2e31ad814b9a36b36b1419f3681440.zip
FreeBSD-src-0b90cf6a6e2e31ad814b9a36b36b1419f3681440.tar.gz
vinumopen: add code to open raw subdisks. This is now used to
initialize subdisks. Probably the plex-related subdisk type will die a death. vinumconfig.c: Accept (and ignore) kernel state information in userland config files. This saves a lot of error recovery and also makes it possible to use the output of printconfig to create new configuration. Remove checkdiskconfig(). It wasn't needed any more. Start adding support for hot spare drives. You can't put anything on them (yet). Change message formats from %lld to %qd. get_empty_sd: Initialize size to -1. Previously this was done in config_subdisk, which is the wrong place. start_config: set current drive, plex and volume to -1, thus stopping update configurations from taking their defaults from old configs.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/vinum/vinum.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index 1844fb3..9bf36e3 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -2,6 +2,8 @@
* Copyright (c) 1997, 1998
* Nan Yang Computer Services Limited. All rights reserved.
*
+ * Written by Greg Lehey
+ *
* This software is distributed under the so-called ``Berkeley
* License'':
*
@@ -33,7 +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.25 1999/06/29 04:07:55 grog Exp $
+ * $Id: vinum.c,v 1.25 1999/06/25 07:54:48 grog Exp grog $
*/
#define STATIC static /* nothing while we're testing XXX */
@@ -266,7 +268,7 @@ vinumopen(dev_t dev,
struct volume *vol;
struct plex *plex;
struct sd *sd;
- int devminor;
+ int devminor; /* minor number */
devminor = minor(dev);
error = 0;
@@ -316,6 +318,10 @@ vinumopen(dev_t dev,
if ((Volno(dev) >= vinum_conf.volumes_allocated) /* no such volume */
||(Plexno(dev) >= vinum_conf.plexes_allocated)) /* or no such plex */
return ENXIO; /* no such device */
+
+ /* FALLTHROUGH */
+
+ case VINUM_RAWSD_TYPE:
index = Sdno(dev); /* get the subdisk number */
if ((index >= vinum_conf.subdisks_allocated) /* not a valid SD entry */
||(SD[index].state < sd_init)) /* or SD is not real */
@@ -336,12 +342,6 @@ vinumopen(dev_t dev,
return 0;
}
- /* Vinum drives are disks. We already have a disk
- * driver, so don't handle them here */
- case VINUM_DRIVE_TYPE:
- default:
- return ENODEV; /* don't know what to do with these */
-
case VINUM_SUPERDEV_TYPE:
error = suser(p); /* are we root? */
if (error == 0) { /* yes, can do */
@@ -354,6 +354,11 @@ vinumopen(dev_t dev,
}
return error;
+ /* Vinum drives are disks. We already have a disk
+ * driver, so don't handle them here */
+ case VINUM_DRIVE_TYPE:
+ default:
+ return ENODEV; /* don't know what to do with these */
}
}
OpenPOWER on IntegriCloud