summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-04 20:05:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-04 20:05:52 +0000
commitf625440ba554d472bb016963725c840a7050e9e0 (patch)
tree99e5c6eb1d1f937a78e6ab5e00c07997a3094eab
parent2c94dfa6516ecec3c5ff1df7d7523e432454f91b (diff)
DIOCGPDINFO support
-rw-r--r--sys/arch/pmax/dev/rz.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/arch/pmax/dev/rz.c b/sys/arch/pmax/dev/rz.c
index 43f5ea0a609..d1b0388c302 100644
--- a/sys/arch/pmax/dev/rz.c
+++ b/sys/arch/pmax/dev/rz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rz.c,v 1.15 1998/10/03 21:18:58 millert Exp $ */
+/* $OpenBSD: rz.c,v 1.16 1998/10/04 20:05:51 millert Exp $ */
/* $NetBSD: rz.c,v 1.38 1998/05/08 00:05:19 simonb Exp $ */
/*
@@ -88,7 +88,7 @@ int rzprobe __P((void /*register struct pmax_scsi_device*/ *sd));
void rzgetdefaultlabel __P((struct rz_softc *, struct disklabel *lp));
void rzstart __P((int unit));
void rzdone __P((int unit, int error, int resid, int status));
-void rzgetinfo __P((dev_t dev));
+void rzgetinfo __P((dev_t, struct rz_softc *, struct disklabel *, int));
int rzsize __P((dev_t dev));
/* Machinery for format and drive inquiry commands. */
@@ -858,12 +858,13 @@ rzdone(unit, error, resid, status)
* Read or constuct a disklabel
*/
void
-rzgetinfo(dev)
+rzgetinfo(dev, sc, lp, spoofonly)
dev_t dev;
+ struct rz_softc *sc;
+ struct disklabel *lp;
+ int spoofonly;
{
register int unit = DISKUNIT(dev);
- register struct rz_softc *sc = &rz_softc[unit];
- register struct disklabel *lp = sc->sc_label;
char *msg;
int part;
struct cpu_disklabel cd;
@@ -909,9 +910,11 @@ rzgetinfo(dev)
/*
* Now try to read the disklabel
*/
- if ((msg = readdisklabel(dev, rzstrategy, lp, &cd, 0)) == NULL)
+ msg = readdisklabel(dev, rzstrategy, lp, &cd, spoofonly);
+ if (msg == NULL && spoofonly == 0)
return;
- printf("rz%d: WARNING: %s\n", unit, msg);
+ else if (msg != NULL)
+ printf("rz%d: WARNING: %s\n", unit, msg);
#ifdef COMPAT_ULTRIX
/*
@@ -925,7 +928,6 @@ rzgetinfo(dev)
rz_setlabelgeom(lp, &sc->params);
return;
}
- printf("rz%d: WARNING: trying Ultrix label, %s\n", unit, msg);
#endif /* COMPAT_ULTRIX */
/*
* No label found, cons up a fake one based on disk geometry.
@@ -958,7 +960,7 @@ rzopen(dev, flags, mode, p)
part = DISKPART(dev);
mask = 1 << part;
if (!(sc->sc_flags & RZF_HAVELABEL))
- rzgetinfo(dev);
+ rzgetinfo(dev, sc, sc->sc_dkdev.dk_label, 0);
/* Check that the partition exists. */
if (part != RAW_PART &&
@@ -1101,6 +1103,10 @@ rzioctl(dev, cmd, data, flag, p)
bcopy((caddr_t)&sc->sc_sense, data, sizeof(sc->sc_sense));
return (0);
+ case DIOCGPDINFO:
+ rzgetinfo(dev, sc, (struct disklabel *)data, 1);
+ return (0);
+
case DIOCGDINFO:
/* get the current disk label */
*(struct disklabel *)data = *(sc->sc_label);