summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2011-06-03 21:14:11 +0000
committermatthew <matthew@openbsd.org>2011-06-03 21:14:11 +0000
commit58d155a8bd341acd2e73b81dea97af3abb749a0c (patch)
treebb8e802bc72a7bc8af785edf9d9be535536ee1f7 /sys/dev
parentone midicat server can export multiple midithru ports (diff)
downloadwireguard-openbsd-58d155a8bd341acd2e73b81dea97af3abb749a0c.tar.xz
wireguard-openbsd-58d155a8bd341acd2e73b81dea97af3abb749a0c.zip
Get rid of the wlabel argument to bounds_check_with_label(). It's
never done anything in OpenBSD and just clutters disk drivers with silly flag handling. More cleanup to follow. ok deraadt@, millert@; no objections krw@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/wd.c5
-rw-r--r--sys/dev/ccd.c6
-rw-r--r--sys/dev/flash.c4
-rw-r--r--sys/dev/isa/mcd.c5
-rw-r--r--sys/dev/raidframe/rf_openbsdkintf.c10
-rw-r--r--sys/dev/ramdisk.c4
-rw-r--r--sys/dev/vnd.c4
7 files changed, 16 insertions, 22 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index aafa13128a1..9a01ca49436 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.101 2011/05/31 17:35:35 matthew Exp $ */
+/* $OpenBSD: wd.c,v 1.102 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -448,8 +448,7 @@ wdstrategy(struct buf *bp)
* Do bounds checking, adjust transfer. if error, process.
* If end of partition, just return.
*/
- if (bounds_check_with_label(bp, wd->sc_dk.dk_label,
- (wd->sc_flags & (WDF_WLABEL|WDF_LABELLING)) != 0) <= 0)
+ if (bounds_check_with_label(bp, wd->sc_dk.dk_label) <= 0)
goto done;
/* Queue transfer on drive, activate drive and controller if idle. */
bufq_queue(&wd->sc_bufq, bp);
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 0fcc9747874..a282d9db13f 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.93 2011/04/12 20:18:13 miod Exp $ */
+/* $OpenBSD: ccd.c,v 1.94 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -649,7 +649,6 @@ ccdstrategy(struct buf *bp)
int unit = DISKUNIT(bp->b_dev);
struct ccd_softc *cs = &ccd_softc[unit];
int s;
- int wlabel;
struct disklabel *lp;
CCD_DPRINTF(CCDB_FOLLOW, ("ccdstrategy(%p): unit %d\n", bp, unit));
@@ -671,8 +670,7 @@ ccdstrategy(struct buf *bp)
* Do bounds checking and adjust transfer. If there's an
* error, the bounds check will flag that for us.
*/
- wlabel = cs->sc_flags & (CCDF_WLABEL|CCDF_LABELLING);
- if (bounds_check_with_label(bp, lp, wlabel) <= 0)
+ if (bounds_check_with_label(bp, lp) <= 0)
goto done;
bp->b_resid = bp->b_bcount;
diff --git a/sys/dev/flash.c b/sys/dev/flash.c
index 0ccfdad15f6..965052e5bfa 100644
--- a/sys/dev/flash.c
+++ b/sys/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.20 2010/09/24 18:27:43 jasper Exp $ */
+/* $OpenBSD: flash.c,v 1.21 2011/06/03 21:14:11 matthew Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
@@ -811,7 +811,7 @@ flashstrategy(struct buf *bp)
goto done;
/* Do bounds checking on partitions. */
- if (bounds_check_with_label(bp, sc->sc_dk.dk_label, 0) <= 0)
+ if (bounds_check_with_label(bp, sc->sc_dk.dk_label) <= 0)
goto done;
/* Queue the transfer. */
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c
index b4012fe2a58..d250f670ae7 100644
--- a/sys/dev/isa/mcd.c
+++ b/sys/dev/isa/mcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mcd.c,v 1.57 2011/06/03 18:22:25 matthew Exp $ */
+/* $OpenBSD: mcd.c,v 1.58 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: mcd.c,v 1.60 1998/01/14 12:14:41 drochner Exp $ */
/*
@@ -506,8 +506,7 @@ mcdstrategy(bp)
* Do bounds checking, adjust transfer. if error, process.
* If end of partition, just return.
*/
- if (bounds_check_with_label(bp, sc->sc_dk.dk_label,
- (sc->flags & (MCDF_WLABEL|MCDF_LABELLING)) != 0) <= 0)
+ if (bounds_check_with_label(bp, sc->sc_dk.dk_label) <= 0)
goto done;
/* Queue it. */
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c
index 87918b57b2f..6122fed877a 100644
--- a/sys/dev/raidframe/rf_openbsdkintf.c
+++ b/sys/dev/raidframe/rf_openbsdkintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_openbsdkintf.c,v 1.61 2011/04/14 20:59:35 pea Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.62 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
@@ -724,7 +724,6 @@ raidstrategy(struct buf *bp)
RF_Raid_t *raidPtr;
struct raid_softc *rs = &raid_softc[raidID];
struct disklabel *lp;
- int wlabel;
s = splbio();
@@ -761,10 +760,9 @@ raidstrategy(struct buf *bp)
* Do bounds checking and adjust transfer. If there's an
* error, the bounds check will flag that for us.
*/
- wlabel = rs->sc_flags & (RAIDF_WLABEL | RAIDF_LABELLING);
- if (bounds_check_with_label(bp, lp, wlabel) <= 0) {
- db1_printf(("Bounds check failed!!:%d %d\n",
- (int)bp->b_blkno, (int)wlabel));
+ if (bounds_check_with_label(bp, lp) <= 0) {
+ db1_printf(("Bounds check failed!!: %d\n",
+ (int)bp->b_blkno));
biodone(bp);
goto raidstrategy_end;
}
diff --git a/sys/dev/ramdisk.c b/sys/dev/ramdisk.c
index ec9de3da28d..2703f5b9c97 100644
--- a/sys/dev/ramdisk.c
+++ b/sys/dev/ramdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ramdisk.c,v 1.51 2011/05/31 17:35:35 matthew Exp $ */
+/* $OpenBSD: ramdisk.c,v 1.52 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: ramdisk.c,v 1.8 1996/04/12 08:30:09 leo Exp $ */
/*
@@ -340,7 +340,7 @@ rdstrategy(struct buf *bp)
}
/* Do not write on "no trespassing" areas... */
- if (bounds_check_with_label(bp, sc->sc_dk.dk_label, 1) <= 0)
+ if (bounds_check_with_label(bp, sc->sc_dk.dk_label) <= 0)
goto bad;
switch (sc->sc_type) {
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index f2526063d99..a54e2a4b6ea 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.123 2011/06/02 19:18:21 deraadt Exp $ */
+/* $OpenBSD: vnd.c,v 1.124 2011/06/03 21:14:11 matthew Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -352,7 +352,7 @@ vndstrategy(struct buf *bp)
/* If we have a label, do a boundary check. */
if (vnd->sc_flags & VNF_HAVELABEL) {
- if (bounds_check_with_label(bp, vnd->sc_dk.dk_label, 1) <= 0) {
+ if (bounds_check_with_label(bp, vnd->sc_dk.dk_label) <= 0) {
s = splbio();
biodone(bp);
splx(s);