diff options
author | 2011-07-06 04:49:35 +0000 | |
---|---|---|
committer | 2011-07-06 04:49:35 +0000 | |
commit | d1e5b14ce27677c18027bd4cc75633df5e5acccf (patch) | |
tree | c7045e866fdf213f4e9aa471ee8f12213caaed7a /sys/kern/subr_disk.c | |
parent | Return the correct error for fchdir(not_file_or_dir) (diff) | |
download | wireguard-openbsd-d1e5b14ce27677c18027bd4cc75633df5e5acccf.tar.xz wireguard-openbsd-d1e5b14ce27677c18027bd4cc75633df5e5acccf.zip |
Eliminate redundant buf validation checks in xxstrategy() methods now
that they're implemented consistently in bounds_check_with_label().
Also, per krw's request, change bounds_check_with_label() to return 0
if the checks succeed, and change the drivers to test == -1 instead of
<= 0. (Man page update to follow; intentionally omitting
arch/vax/mba/hp.c from this commit because it doesn't even build
currently and miod@ promises to kill it soon.)
ok krw@
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index ff3765eeacf..9c41426adc4 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.128 2011/07/05 04:05:04 matthew Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.129 2011/07/06 04:49:36 matthew Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -717,7 +717,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp) /* calculate cylinder for disksort to order transfers with */ bp->b_cylinder = (bp->b_blkno + DL_SECTOBLK(lp, DL_GETPOFFSET(p))) / DL_SECTOBLK(lp, lp->d_secpercyl); - return (1); + return (0); bad: bp->b_error = EINVAL; |