summaryrefslogtreecommitdiff
path: root/sbin/bioctl/bioctl.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2008-01-19 23:53:54 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2008-01-19 23:53:54 +0000
commitbf333f52b61a964fd4f800b1c07897d3189617a0 (patch)
tree45f024f8b9a5131939e238ebe0a20e16730ba721 /sbin/bioctl/bioctl.c
parent5e1334fb85327317b53d3cd67f84c452c9d27908 (diff)
Add initial scaffold for RAID 0. No IO just yet.
Much prodding todd
Diffstat (limited to 'sbin/bioctl/bioctl.c')
-rw-r--r--sbin/bioctl/bioctl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index a57451961d5..e42ef153261 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioctl.c,v 1.61 2007/09/08 07:21:29 henning Exp $ */
+/* $OpenBSD: bioctl.c,v 1.62 2008/01/19 23:53:53 marco Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
@@ -600,11 +600,14 @@ bio_createraid(u_int16_t level, char *dev_list)
switch (level) {
case 0:
- min_disks = 1;
+ min_disks = 2;
break;
case 1:
min_disks = 2;
break;
+ case 'C':
+ min_disks = 2;
+ break;
case 'c':
min_disks = 1;
break;
@@ -612,6 +615,9 @@ bio_createraid(u_int16_t level, char *dev_list)
errx(1, "unsupported raid level");
}
+ if (no_dev < min_disks)
+ errx(1, "not enough disks");
+
memset(&create, 0, sizeof(create));
create.bc_cookie = bl.bl_cookie;
create.bc_level = level;