summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2003-05-04 05:16:02 +0000
committergrog <grog@FreeBSD.org>2003-05-04 05:16:02 +0000
commit8d151fcbbf39ef6336be334ee44ce1ba28e6778c (patch)
treef1317b222a5e9b5e1389e636f926609408f5debd /sys
parentcfcc0b70acf4c704ff7e96404e33042f70edbc9f (diff)
downloadFreeBSD-src-8d151fcbbf39ef6336be334ee44ce1ba28e6778c.zip
FreeBSD-src-8d151fcbbf39ef6336be334ee44ce1ba28e6778c.tar.gz
Rewrite of startup code:
Add ioctl VINUM_READCONFIG which implements both the "read" and "start" commands in vinum(8). Aim for marginally better error messages when something goes wrong.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/vinum/vinumioctl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index 15e96c1..ea734c8 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/dev/vinum/vinumioctl.c
@@ -289,6 +289,24 @@ vinum_super_ioctl(dev_t dev,
error = EINVAL; /* release what config? */
return error;
+ case VINUM_READCONFIG:
+ error = lock_config(); /* get the config for us alone */
+ if (error) /* can't do it, */
+ return error; /* give up */
+ if (((char *) data)[0] == '\0')
+ ioctl_reply->error = vinum_scandisk(NULL); /* built your own list */
+ else
+ ioctl_reply->error = vinum_scandisk((char *) data);
+ if (ioctl_reply->error == ENOENT) {
+ if (vinum_conf.drives_used > 0)
+ strcpy(ioctl_reply->msg, "no additional drives found");
+ else
+ strcpy(ioctl_reply->msg, "no drives found");
+ } else if (ioctl_reply->error)
+ strcpy(ioctl_reply->msg, "can't read configuration information, see log file");
+ unlock_config();
+ return 0; /* must be 0 to return the real error info */
+
case VINUM_INIT:
ioctl_reply = (struct _ioctl_reply *) data; /* reinstate the address to reply to */
ioctl_reply->error = 0;
OpenPOWER on IntegriCloud