summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2001-05-22 02:33:32 +0000
committergrog <grog@FreeBSD.org>2001-05-22 02:33:32 +0000
commit86233b07badbdc56a1a571faeb4d3ec94a227f81 (patch)
tree74e4aed751cf88cc0784df929a69bb38e21bd887 /sys/dev/vinum
parente7843236bc58f636de95336b051aee3e3a01c43b (diff)
downloadFreeBSD-src-86233b07badbdc56a1a571faeb4d3ec94a227f81.zip
FreeBSD-src-86233b07badbdc56a1a571faeb4d3ec94a227f81.tar.gz
Change ioctls to use the expurgated userland version of the Vinum
structures.
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumio.h12
-rw-r--r--sys/dev/vinum/vinumioctl.c16
-rw-r--r--sys/dev/vinum/vinumkw.h14
3 files changed, 22 insertions, 20 deletions
diff --git a/sys/dev/vinum/vinumio.h b/sys/dev/vinum/vinumio.h
index cca47b8..5930624 100644
--- a/sys/dev/vinum/vinumio.h
+++ b/sys/dev/vinum/vinumio.h
@@ -108,12 +108,12 @@ struct vinum_rename_msg {
/* ioctl requests */
#define BUFSIZE 1024 /* size of buffer, including continuations */
#define VINUM_CREATE _IOC(IOC_IN | IOC_OUT, L, 64, BUFSIZE) /* configure vinum */
-#define VINUM_GETCONFIG _IOR(L, 65, struct _vinum_conf) /* get global config */
-#define VINUM_DRIVECONFIG _IOWR(L, 66, struct drive) /* get drive config */
-#define VINUM_SDCONFIG _IOWR(L, 67, struct sd) /* get subdisk config */
-#define VINUM_PLEXCONFIG _IOWR(L, 68, struct plex) /* get plex config */
-#define VINUM_VOLCONFIG _IOWR(L, 69, struct volume) /* get volume config */
-#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct sd) /* get sd config for plex (plex, sdno) */
+#define VINUM_GETCONFIG _IOR(L, 65, struct __vinum_conf) /* get global config */
+#define VINUM_DRIVECONFIG _IOWR(L, 66, struct _drive) /* get drive config */
+#define VINUM_SDCONFIG _IOWR(L, 67, struct _sd) /* get subdisk config */
+#define VINUM_PLEXCONFIG _IOWR(L, 68, struct _plex) /* get plex config */
+#define VINUM_VOLCONFIG _IOWR(L, 69, struct _volume) /* get volume config */
+#define VINUM_PLEXSDCONFIG _IOWR(L, 70, struct _sd) /* get sd config for plex (plex, sdno) */
#define VINUM_GETFREELIST _IOWR(L, 71, struct drive_freelist) /* get freelist element (drive, fe) */
#define VINUM_SAVECONFIG _IOW(L, 72, int) /* write config to disk */
#define VINUM_RESETCONFIG _IOC(0, L, 73, 0) /* trash config on disk */
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index 8780e1c..bef310b 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/dev/vinum/vinumioctl.c
@@ -41,7 +41,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumioctl.c,v 1.12 2000/02/29 02:20:31 grog Exp grog $
+ * $Id: vinumioctl.c,v 1.14 2000/10/27 03:07:53 grog Exp grog $
* $FreeBSD$
*/
@@ -135,28 +135,28 @@ vinumioctl(dev_t dev,
index = *(int *) data; /* get the index */
if (index >= (unsigned) vinum_conf.drives_allocated) /* can't do it */
return ENXIO; /* bang */
- bcopy(&DRIVE[index], data, sizeof(struct drive)); /* copy the config item out */
+ bcopy(&DRIVE[index], data, sizeof(struct _drive)); /* copy the config item out */
return 0;
case VINUM_SDCONFIG:
index = *(int *) data; /* get the index */
if (index >= (unsigned) vinum_conf.subdisks_allocated) /* can't do it */
return ENXIO; /* bang */
- bcopy(&SD[index], data, sizeof(struct sd)); /* copy the config item out */
+ bcopy(&SD[index], data, sizeof(struct _sd)); /* copy the config item out */
return 0;
case VINUM_PLEXCONFIG:
index = *(int *) data; /* get the index */
if (index >= (unsigned) vinum_conf.plexes_allocated) /* can't do it */
return ENXIO; /* bang */
- bcopy(&PLEX[index], data, sizeof(struct plex)); /* copy the config item out */
+ bcopy(&PLEX[index], data, sizeof(struct _plex)); /* copy the config item out */
return 0;
case VINUM_VOLCONFIG:
index = *(int *) data; /* get the index */
if (index >= (unsigned) vinum_conf.volumes_allocated) /* can't do it */
return ENXIO; /* bang */
- bcopy(&VOL[index], data, sizeof(struct volume)); /* copy the config item out */
+ bcopy(&VOL[index], data, sizeof(struct _volume)); /* copy the config item out */
return 0;
case VINUM_PLEXSDCONFIG:
@@ -167,7 +167,7 @@ vinumioctl(dev_t dev,
return ENXIO; /* bang */
bcopy(&SD[PLEX[index].sdnos[sdno]], /* copy the config item out */
data,
- sizeof(struct sd));
+ sizeof(struct _sd));
return 0;
/*
@@ -666,7 +666,7 @@ detachobject(struct vinum_ioctl_msg *msg)
} else { /* valid plex number */
plex = &PLEX[sd->plexno];
if ((!msg->force) /* don't force things */
-&&((plex->state == plex_up) /* and the plex is up */
+ &&((plex->state == plex_up) /* and the plex is up */
||((plex->state == plex_flaky) && sd->state == sd_up))) { /* or flaky with this sd up */
reply->error = EBUSY; /* we need this sd */
reply->msg[0] = '\0';
@@ -716,7 +716,7 @@ detachobject(struct vinum_ioctl_msg *msg)
vol = &VOL[volno];
if ((!msg->force) /* don't force things */
-&&((vol->state == volume_up) /* and the volume is up */
+ &&((vol->state == volume_up) /* and the volume is up */
&&(vol->plexes == 1))) { /* and this is the last plex */
/*
* XXX As elsewhere, check whether we will lose
diff --git a/sys/dev/vinum/vinumkw.h b/sys/dev/vinum/vinumkw.h
index b312bf0..7807222 100644
--- a/sys/dev/vinum/vinumkw.h
+++ b/sys/dev/vinum/vinumkw.h
@@ -13,11 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Nan Yang Computer
- * Services Limited.
- * 4. Neither the name of the Company nor the names of its contributors
+ * 3. Neither the name of the Company nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -33,7 +29,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumkw.h,v 1.16 2000/02/19 06:52:46 grog Exp grog $
+ * $Id: vinumkw.h,v 1.17 2000/05/20 08:23:07 grog Exp grog $
* $FreeBSD$
*/
@@ -128,6 +124,7 @@ enum keyword {
kw_checkparity,
kw_rebuildparity,
kw_dumpconfig,
+ kw_retryerrors,
kw_invalid_keyword = -1
};
@@ -146,3 +143,8 @@ extern struct _keywords flag_keywords[];
extern struct keywordset keyword_set;
extern struct keywordset flag_set;
+
+/* Parser functions */
+
+enum keyword get_keyword(char *, struct keywordset *);
+int tokenize(char *, char *[], int);
OpenPOWER on IntegriCloud