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/amiga | |
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/amiga')
-rw-r--r-- | sys/arch/amiga/amiga/disksubr.c | 5 | ||||
-rw-r--r-- | sys/arch/amiga/dev/fd.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/amiga/amiga/disksubr.c b/sys/arch/amiga/amiga/disksubr.c index 80739dc94bf..261b41ee638 100644 --- a/sys/arch/amiga/amiga/disksubr.c +++ b/sys/arch/amiga/amiga/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.13 1997/05/29 01:18:18 niklas Exp $ */ +/* $OpenBSD: disksubr.c,v 1.14 1997/08/08 21:46:34 niklas Exp $ */ /* $NetBSD: disksubr.c,v 1.27 1996/10/13 03:06:34 christos Exp $ */ /* @@ -502,9 +502,10 @@ writedisklabel(dev, strat, lp, clp) } 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)) diff --git a/sys/arch/amiga/dev/fd.c b/sys/arch/amiga/dev/fd.c index 46f0d15589f..5f8088057ec 100644 --- a/sys/arch/amiga/dev/fd.c +++ b/sys/arch/amiga/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.11 1997/01/16 09:24:03 niklas Exp $ */ +/* $OpenBSD: fd.c,v 1.12 1997/08/08 21:46:35 niklas Exp $ */ /* $NetBSD: fd.c,v 1.36 1996/12/23 09:09:59 veego Exp $ */ /* @@ -705,7 +705,8 @@ fdstrategy(bp) bp->b_error = EIO; goto bad; } - if (bounds_check_with_label(bp, lp, sc->wlabel) <= 0) + if (bounds_check_with_label(bp, lp, sc->dkdev.dk_cpulabel, sc->wlabel) + <= 0) goto done; /* |