summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid_raid0.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2012-01-22 11:13:31 +0000
committerjsing <jsing@openbsd.org>2012-01-22 11:13:31 +0000
commit5f08213045e07b53e05e099b8011005b75850cdb (patch)
treebcc175e8e425f4129c876ff433d9ca0d0e211f6c /sys/dev/softraid_raid0.c
parentIf no controller name is provided, use the program name as a prefix. Also, (diff)
downloadwireguard-openbsd-5f08213045e07b53e05e099b8011005b75850cdb.tar.xz
wireguard-openbsd-5f08213045e07b53e05e099b8011005b75850cdb.zip
Convert softraid(4) to new bio(4) status interface. This allows bioctl(8)
to provide useful feedback, rather than reporting an ioctl failure and leaving the user to consult dmesg. For now we continue to print most things to the console, even if the message is a result of an ioctl.
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r--sys/dev/softraid_raid0.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index a9c7e5a7d60..a686fef700e 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.25 2011/12/26 14:54:52 jsing Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.26 2012/01/22 11:13:32 jsing Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -75,9 +75,10 @@ int
sr_raid0_create(struct sr_discipline *sd, struct bioc_createraid *bc,
int no_chunk, int64_t coerced_size)
{
-
- if (no_chunk < 2)
+ if (no_chunk < 2) {
+ sr_error(sd->sd_sc, "RAID 0 requires two or more chunks");
return EINVAL;
+ }
/*
* XXX add variable strip size later even though MAXPHYS is really