diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-08-08 21:47:07 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-08-08 21:47:07 +0000 |
commit | e83b776d913d8ba599aa39549c620fb533c8de53 (patch) | |
tree | 91402695de0f0016c37fac593b91f9316fa38b34 /sys/arch/vax | |
parent | fa3ac60890d403b6994891797ae40ea98456004a (diff) |
Change the bounds_check_with_label API to also take a cpu_disklabel
reference for making transferral of meta-information possible from
readdisklabel to bounds_check_with_label. The first (and maybe only)
thing that will use this is the multi-disklabel-format code on the
alpha where the labelsector is passed via cpu_disklabel so the label
write-protection can work correctly no matter what label was found.
Also use a new macro DKBAD to get at the dkbad field of the cpu_disklabel
implementations that contain it. This too is for multi-disklabel
architectures where the "bad" field can be inside a union. Use this
macro as a means for a driver to check if an architecture supports
dkbad constructs.
Remove proto of bounds_check_with_label from all MD disklabel.h as it
is in sys/disklabel.h.
I have not been able to test the changes everywhere, if I break anything
I apologize, and promise to fix it as soon as I become aware of it.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/mba/hp.c | 6 | ||||
-rw-r--r-- | sys/arch/vax/mscp/mscp_disk.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c index 15dfe30a331..3195f48f71c 100644 --- a/sys/arch/vax/mba/hp.c +++ b/sys/arch/vax/mba/hp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hp.c,v 1.5 1997/05/29 00:04:58 niklas Exp $ */ +/* $OpenBSD: hp.c,v 1.6 1997/08/08 21:46:56 niklas Exp $ */ /* $NetBSD: hp.c,v 1.12 1996/10/13 03:34:58 christos Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -178,8 +178,8 @@ hpstrategy(bp) unit = DISKUNIT(bp->b_dev); sc = hp_cd.cd_devs[unit]; - if (bounds_check_with_label(bp, sc->sc_disk.dk_label, sc->sc_wlabel) - <= 0) + if (bounds_check_with_label(bp, sc->sc_disk.dk_label, + sc->sc_disk.dk_cpulabel, sc->sc_wlabel) <= 0) goto done; s = splbio(); diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c index f49d8a412f3..54c3f01484b 100644 --- a/sys/arch/vax/mscp/mscp_disk.c +++ b/sys/arch/vax/mscp/mscp_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mscp_disk.c,v 1.2 1997/05/29 00:05:02 niklas Exp $ */ +/* $OpenBSD: mscp_disk.c,v 1.3 1997/08/08 21:46:56 niklas Exp $ */ /* $NetBSD: mscp_disk.c,v 1.7 1997/01/11 11:20:32 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -382,7 +382,7 @@ rastrategy(bp) } } else if (bounds_check_with_label(bp, ra->ra_disk.dk_label, - ra->ra_wlabel) <= 0) { + ra->ra_disk.dk_cpulabel, ra->ra_wlabel) <= 0) { bp->b_error = ENXIO; goto bad; } diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index bb24cef3c4a..6861cbf435d 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.7 1997/05/29 00:05:16 niklas Exp $ */ +/* $OpenBSD: disksubr.c,v 1.8 1997/08/08 21:46:57 niklas Exp $ */ /* $NetBSD: disksubr.c,v 1.11 1997/01/11 11:24:51 ragge Exp $ */ /* @@ -66,9 +66,10 @@ int cpu_writedisklabel __P((dev_t, void (*)(struct buf *), * if needed, and signal errors or early completion. */ int -bounds_check_with_label(bp, lp, wlabel) +bounds_check_with_label(bp, lp, osdep, wlabel) struct buf *bp; struct disklabel *lp; + struct cpu_disklabel *osdep; int wlabel; { #define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) |