Change bounds_check_with_label() to take a pointer to the disk structure,

rather than the label itself.  This paves the way for some future changes.
This commit is contained in:
thorpej 2003-05-10 23:12:28 +00:00
parent 0094fe5bbb
commit e43fecb228
62 changed files with 216 additions and 179 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.7 2003/05/02 08:45:24 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.8 2003/05/10 23:12:28 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.7 2003/05/02 08:45:24 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.8 2003/05/10 23:12:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -237,8 +237,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsect = lp->d_partitions[RAW_PART].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.26 2003/05/02 08:45:23 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.27 2003/05/10 23:12:29 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.26 2003/05/02 08:45:23 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.27 2003/05/10 23:12:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -262,11 +262,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsect = lp->d_partitions[RAW_PART].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/08 20:36:49 fvdl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:29 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -471,11 +471,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.43 2003/05/02 08:45:22 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.44 2003/05/10 23:12:30 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.43 2003/05/02 08:45:22 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.44 2003/05/10 23:12:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -510,11 +510,12 @@ writedisklabel(dev, strat, lp, clp)
}
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *pp;
long maxsz, sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.60 2003/05/03 18:10:43 wiz Exp $ */
/* $NetBSD: fd.c,v 1.61 2003/05/10 23:12:30 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.60 2003/05/03 18:10:43 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.61 2003/05/10 23:12:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -664,7 +664,7 @@ fdstrategy(struct buf *bp)
bp->b_error = EIO;
goto bad;
}
if (bounds_check_with_label(bp, lp, sc->wlabel) <= 0)
if (bounds_check_with_label(&sc->dkdev, bp, sc->wlabel) <= 0)
goto done;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.15 2003/05/02 08:45:22 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.16 2003/05/10 23:12:30 thorpej Exp $ */
/* $OpenBSD: disksubr.c,v 1.14 1997/05/08 00:14:29 deraadt Exp $ */
/* NetBSD: disksubr.c,v 1.40 1999/05/06 15:45:51 christos Exp */
@ -514,11 +514,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.6 2003/05/02 08:45:22 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.7 2003/05/10 23:12:31 thorpej Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
@ -384,11 +384,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.27 2003/05/02 08:45:21 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.28 2003/05/10 23:12:31 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@ -68,11 +68,12 @@ static u_int ahdi_getparts __P((dev_t, void (*)(struct buf *), u_int,
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *pp;
u_int maxsz, sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.11 2003/05/02 08:45:21 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2003/05/10 23:12:31 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -467,11 +467,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.9 2003/05/02 08:45:21 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.10 2003/05/10 23:12:32 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -408,11 +408,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/02 08:45:21 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:32 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -232,8 +232,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.3 2003/05/02 08:45:19 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.4 2003/05/10 23:12:32 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -265,8 +265,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.15 2003/05/02 08:45:20 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.16 2003/05/10 23:12:32 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.15 2003/05/02 08:45:20 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.16 2003/05/10 23:12:32 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -201,11 +201,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = &lp->d_partitions[DISKPART(bp->b_dev)];
int labelsect = lp->d_partitions[0].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.3 2003/05/02 08:45:19 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.4 2003/05/10 23:12:33 thorpej Exp $ */
/* $OpenBSD: disksubr.c,v 1.6 2000/10/18 21:00:34 mickey Exp $ */
@ -831,12 +831,13 @@ writedisklabel(dev, strat, lp, osdep)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = blockpersec(lp->d_partitions[RAW_PART].p_offset,
lp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.5 2003/05/02 08:45:20 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.6 2003/05/10 23:12:33 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -456,8 +456,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.53 2003/05/08 20:36:12 fvdl Exp $ */
/* $NetBSD: disksubr.c,v 1.54 2003/05/10 23:12:33 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.53 2003/05/08 20:36:12 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.54 2003/05/10 23:12:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -474,11 +474,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.13 2003/05/02 08:45:20 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.14 2003/05/10 23:12:34 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -265,11 +265,12 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p;
int sz, maxsz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.44 2003/05/02 08:45:20 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.45 2003/05/10 23:12:34 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -621,11 +621,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
#if 0
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.27 2003/05/02 08:45:20 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.28 2003/05/10 23:12:34 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -712,11 +712,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.11 2003/05/02 08:45:24 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2003/05/10 23:12:35 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -255,12 +255,12 @@ ioerror:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + dkpart(bp->b_dev);
int labelsect = lp->d_partitions[0].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.24 2003/05/02 08:45:19 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.25 2003/05/10 23:12:35 thorpej Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@ -253,11 +253,12 @@ writedisklabel(dev, strat, lp, clp)
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int maxsz = p->p_size;
int sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/02 08:45:17 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:35 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -465,11 +465,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.15 2003/05/02 08:45:18 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.16 2003/05/10 23:12:36 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -195,12 +195,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
u_int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.13 2003/05/02 08:45:18 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.14 2003/05/10 23:12:36 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -195,12 +195,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
u_int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.11 2003/05/02 08:45:18 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2003/05/10 23:12:36 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -503,11 +503,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = &lp->d_partitions[DISKPART(bp->b_dev)];
int labelsect = lp->d_partitions[0].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.13 2003/05/02 08:45:18 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.14 2003/05/10 23:12:36 thorpej Exp $ */
/*
* Copyright (C) 1996 Wolfgang Solfrank.
@ -325,11 +325,12 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.23 2003/05/02 08:45:18 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.24 2003/05/10 23:12:37 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -204,8 +204,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int maxsz = p->p_size,
sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/02 08:45:17 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:37 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -396,8 +396,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.38 2003/05/02 08:45:17 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.39 2003/05/10 23:12:37 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -301,12 +301,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsect = lp->d_partitions[RAW_PART].p_offset;
int maxsz = p->p_size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.3 2003/05/02 08:45:19 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.4 2003/05/10 23:12:37 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -461,8 +461,9 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.6 2003/05/02 08:45:17 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.7 2003/05/10 23:12:38 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -466,11 +466,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/02 08:45:17 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:38 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -465,11 +465,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.5 2003/05/02 08:45:13 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.6 2003/05/10 23:12:38 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -408,11 +408,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.10 2003/05/02 08:45:16 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.11 2003/05/10 23:12:38 thorpej Exp $ */
/*
* Copyright (c) 2001 Christopher Sekiya
@ -221,8 +221,9 @@ ioerror:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int maxsz = p->p_size;
int sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.11 2003/05/02 08:45:16 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.12 2003/05/10 23:12:39 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -689,8 +689,9 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.34 2003/05/02 08:45:16 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.35 2003/05/10 23:12:40 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -232,11 +232,12 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int maxsz = p->p_size;
int sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.16 2003/05/02 08:45:16 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.17 2003/05/10 23:12:40 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -231,11 +231,12 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int maxsz = p->p_size;
int sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.43 2003/05/02 08:45:12 dsl Exp $ */
/* $NetBSD: xd.c,v 1.44 2003/05/10 23:12:40 thorpej Exp $ */
/*
*
@ -1070,7 +1070,7 @@ xdstrategy(bp)
* partition. Adjust transfer if needed, and signal errors or early
* completion. */
if (bounds_check_with_label(bp, xd->sc_dk.dk_label,
if (bounds_check_with_label(&xd->sc_dk, bp,
(xd->flags & XD_WLABEL) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.45 2003/05/02 08:45:11 dsl Exp $ */
/* $NetBSD: xy.c,v 1.46 2003/05/10 23:12:40 thorpej Exp $ */
/*
*
@ -1027,7 +1027,7 @@ xystrategy(bp)
lp = xy->sc_dk.dk_label;
if (bounds_check_with_label(bp, lp,
if (bounds_check_with_label(&xy->sc_dk, bp,
(xy->flags & XY_WLABEL) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.30 2003/05/02 08:45:15 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.31 2003/05/10 23:12:41 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -245,11 +245,12 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p;
int sz, maxsz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.4 2003/05/02 08:45:15 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.5 2003/05/10 23:12:41 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -245,11 +245,12 @@ writedisklabel(dev, strat, lp, clp)
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p;
int sz, maxsz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hp.c,v 1.33 2003/05/02 08:45:11 dsl Exp $ */
/* $NetBSD: hp.c,v 1.34 2003/05/10 23:12:41 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -192,7 +192,7 @@ hpstrategy(struct buf *bp)
sc = hp_cd.cd_devs[unit];
lp = sc->sc_disk.dk_label;
err = bounds_check_with_label(bp, lp, sc->sc_wlabel);
err = bounds_check_with_label(&sc->sc_disk, bp, sc->sc_wlabel);
if (err <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.33 2003/05/02 08:45:15 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.34 2003/05/10 23:12:42 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -69,8 +69,9 @@ char *compat_label(dev_t dev, void (*strat)(struct buf *bp),
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
bounds_check_with_label(struct disk *dk, struct buf *bp, int wlabel)
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsect = lp->d_partitions[2].p_offset;
int maxsz = p->p_size,

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdc9224.c,v 1.27 2003/05/02 08:45:11 dsl Exp $ */
/* $NetBSD: hdc9224.c,v 1.28 2003/05/10 23:12:42 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -445,7 +445,7 @@ rdstrategy(struct buf *bp)
sc = (void *)rd->sc_dev.dv_parent;
lp = rd->sc_disk.dk_label;
if ((bounds_check_with_label(bp, lp, 1)) <= 0)
if ((bounds_check_with_label(&rd->sc_disk, bp, 1)) <= 0)
goto done;
if (bp->b_bcount == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.19 2003/05/02 08:45:14 dsl Exp $ */
/* $NetBSD: disksubr.c,v 1.20 2003/05/10 23:12:42 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -475,11 +475,12 @@ done:
* if needed, and signal errors or early completion.
*/
int
bounds_check_with_label(bp, lp, wlabel)
bounds_check_with_label(dk, bp, wlabel)
struct disk *dk;
struct buf *bp;
struct disklabel *lp;
int wlabel;
{
struct disklabel *lp = dk->dk_label;
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
int sz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.251 2003/05/02 08:45:25 dsl Exp $ */
/* $NetBSD: wd.c,v 1.252 2003/05/10 23:12:44 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.251 2003/05/02 08:45:25 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.252 2003/05/10 23:12:44 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -520,7 +520,7 @@ wdstrategy(bp)
wd->sc_capacity) <= 0)
goto done;
} else {
if (bounds_check_with_label(bp, wd->sc_dk.dk_label,
if (bounds_check_with_label(&wd->sc_dk, bp,
(wd->sc_flags & (WDF_WLABEL|WDF_LABELLING)) != 0) <= 0)
goto done;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ccd.c,v 1.85 2003/05/02 08:45:26 dsl Exp $ */
/* $NetBSD: ccd.c,v 1.86 2003/05/10 23:12:43 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.85 2003/05/02 08:45:26 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.86 2003/05/10 23:12:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -649,7 +649,7 @@ ccdstrategy(bp)
*/
wlabel = cs->sc_flags & (CCDF_WLABEL|CCDF_LABELLING);
if (DISKPART(bp->b_dev) != RAW_PART)
if (bounds_check_with_label(bp, lp, wlabel) <= 0)
if (bounds_check_with_label(&cs->sc_dkdev, bp, wlabel) <= 0)
goto done;
bp->b_resid = bp->b_bcount;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dksubr.c,v 1.5 2003/05/02 08:45:26 dsl Exp $ */
/* $NetBSD: dksubr.c,v 1.6 2003/05/10 23:12:43 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@ -195,7 +195,7 @@ dk_strategy(struct dk_intf *di, struct dk_softc *dksc, struct buf *bp)
wlabel = dksc->sc_flags & (DKF_WLABEL|DKF_LABELLING);
if (DISKPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, lp, wlabel) <= 0) {
bounds_check_with_label(&dksc->sc_dkdev, bp, wlabel) <= 0) {
biodone(bp);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcd.c,v 1.81 2002/11/01 11:31:57 mrg Exp $ */
/* $NetBSD: mcd.c,v 1.82 2003/05/10 23:12:44 thorpej Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -56,7 +56,7 @@
/*static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.81 2002/11/01 11:31:57 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.82 2003/05/10 23:12:44 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -501,7 +501,7 @@ mcdstrategy(bp)
* If end of partition, just return.
*/
if (MCDPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, lp,
bounds_check_with_label(&sc->sc_dk, bp,
(sc->flags & (MCDF_WLABEL|MCDF_LABELLING)) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld.c,v 1.19 2003/01/27 02:43:30 thorpej Exp $ */
/* $NetBSD: ld.c,v 1.20 2003/05/10 23:12:43 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.19 2003/01/27 02:43:30 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.20 2003/05/10 23:12:43 thorpej Exp $");
#include "rnd.h"
@ -510,7 +510,7 @@ ldstart(struct ld_softc *sc, struct buf *bp)
* If past the end of partition, just return.
*/
if (part != RAW_PART &&
bounds_check_with_label(bp, lp,
bounds_check_with_label(&sc->sc_dk, bp,
(sc->sc_flags & (LDF_WLABEL | LDF_LABELLING)) != 0) <= 0) {
bp->b_resid = bp->b_bcount;
biodone(bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ed_mca.c,v 1.19 2003/05/02 08:45:27 dsl Exp $ */
/* $NetBSD: ed_mca.c,v 1.20 2003/05/10 23:12:45 thorpej Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.19 2003/05/02 08:45:27 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.20 2003/05/10 23:12:45 thorpej Exp $");
#include "rnd.h"
#include "locators.h"
@ -242,7 +242,7 @@ edmcastrategy(bp)
* If end of partition, just return.
*/
if (DISKPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, ed->sc_dk.dk_label,
bounds_check_with_label(&ed->sc_dk, bp,
(ed->sc_flags & (WDF_WLABEL|WDF_LABELLING)) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_disk.c,v 1.40 2003/05/02 08:45:27 dsl Exp $ */
/* $NetBSD: mscp_disk.c,v 1.41 2003/05/10 23:12:45 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* Copyright (c) 1988 Regents of the University of California.
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.40 2003/05/02 08:45:27 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.41 2003/05/10 23:12:45 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -332,8 +332,7 @@ rastrategy(bp)
* Determine the size of the transfer, and make sure it is
* within the boundaries of the partition.
*/
if (bounds_check_with_label(bp, ra->ra_disk.dk_label,
ra->ra_wlabel) <= 0)
if (bounds_check_with_label(&ra->ra_disk, bp, ra->ra_wlabel) <= 0)
goto done;
/* Make some statistics... /bqt */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofdisk.c,v 1.26 2003/05/02 08:45:27 dsl Exp $ */
/* $NetBSD: ofdisk.c,v 1.27 2003/05/10 23:12:46 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.26 2003/05/02 08:45:27 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.27 2003/05/10 23:12:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -251,7 +251,7 @@ ofdisk_strategy(struct buf *bp)
OF_io = bp->b_flags & B_READ ? OF_read : OF_write;
if (DISKPART(bp->b_dev) != RAW_PART) {
if (bounds_check_with_label(bp, of->sc_dk.dk_label, 0) <= 0) {
if (bounds_check_with_label(&of->sc_dk, bp, 0) <= 0) {
bp->b_resid = bp->b_bcount;
goto done;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rl.c,v 1.20 2003/05/02 08:45:27 dsl Exp $ */
/* $NetBSD: rl.c,v 1.21 2003/05/10 23:12:46 thorpej Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.20 2003/05/02 08:45:27 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.21 2003/05/10 23:12:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -379,7 +379,7 @@ rlstrategy(struct buf *bp)
panic("rlstrategy: state impossible");
lp = rc->rc_disk.dk_label;
if ((err = bounds_check_with_label(bp, lp, 1)) <= 0)
if ((err = bounds_check_with_label(&rc->rc_disk, bp, 1)) <= 0)
goto done;
if (bp->b_bcount == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.158 2003/05/02 08:45:28 dsl Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.159 2003/05/10 23:12:46 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -111,7 +111,7 @@
***********************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.158 2003/05/02 08:45:28 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.159 2003/05/10 23:12:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -706,7 +706,7 @@ raidstrategy(bp)
wlabel = rs->sc_flags & (RAIDF_WLABEL | RAIDF_LABELLING);
if (DISKPART(bp->b_dev) != RAW_PART)
if (bounds_check_with_label(bp, lp, wlabel) <= 0) {
if (bounds_check_with_label(&rs->sc_dkdev, bp, wlabel) <= 0) {
db1_printf(("Bounds check failed!!:%d %d\n",
(int) bp->b_blkno, (int) wlabel));
biodone(bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd.c,v 1.182 2003/05/02 08:45:29 dsl Exp $ */
/* $NetBSD: cd.c,v 1.183 2003/05/10 23:12:47 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.182 2003/05/02 08:45:29 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.183 2003/05/10 23:12:47 thorpej Exp $");
#include "rnd.h"
@ -589,7 +589,7 @@ cdstrategy(bp)
cd->params.disksize512) <= 0)
goto done;
} else {
if (bounds_check_with_label(bp, lp,
if (bounds_check_with_label(&cd->sc_dk, bp,
(cd->flags & (CDF_WLABEL|CDF_LABELLING)) != 0) <= 0)
goto done;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cdvar.h,v 1.16 2003/04/03 22:18:24 fvdl Exp $ */
/* $NetBSD: cdvar.h,v 1.17 2003/05/10 23:12:47 thorpej Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@ -47,7 +47,7 @@ struct cd_softc {
struct scsipi_periph *sc_periph;
struct cd_parms {
int blksize;
u_int blksize;
u_long disksize; /* total number sectors */
u_long disksize512; /* total number sectors */
} params;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sd.c,v 1.198 2003/05/02 08:45:28 dsl Exp $ */
/* $NetBSD: sd.c,v 1.199 2003/05/10 23:12:47 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.198 2003/05/02 08:45:28 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.199 2003/05/10 23:12:47 thorpej Exp $");
#include "opt_scsi.h"
#include "opt_bufq.h"
@ -636,7 +636,7 @@ sdstrategy(bp)
sd->params.disksize512) <= 0)
goto done;
} else {
if (bounds_check_with_label(bp, lp,
if (bounds_check_with_label(&sd->sc_dk, bp,
(sd->flags & (SDF_WLABEL|SDF_LABELLING)) != 0) <= 0)
goto done;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.48 2003/05/02 08:45:30 dsl Exp $ */
/* $NetBSD: xd.c,v 1.49 2003/05/10 23:12:48 thorpej Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.48 2003/05/02 08:45:30 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.49 2003/05/10 23:12:48 thorpej Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@ -1282,7 +1282,7 @@ xdstrategy(bp)
* partition. Adjust transfer if needed, and signal errors or early
* completion. */
if (bounds_check_with_label(bp, xd->sc_dk.dk_label,
if (bounds_check_with_label(&xd->sc_dk, bp,
(xd->flags & XD_WLABEL) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.48 2003/05/02 08:45:29 dsl Exp $ */
/* $NetBSD: xy.c,v 1.49 2003/05/10 23:12:48 thorpej Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.48 2003/05/02 08:45:29 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.49 2003/05/10 23:12:48 thorpej Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@ -1199,7 +1199,7 @@ xystrategy(bp)
lp = xy->sc_dk.dk_label;
if (bounds_check_with_label(bp, lp,
if (bounds_check_with_label(&xy->sc_dk, bp,
(xy->flags & XY_WLABEL) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnd.c,v 1.97 2003/05/02 08:45:26 dsl Exp $ */
/* $NetBSD: vnd.c,v 1.98 2003/05/10 23:12:43 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.97 2003/05/02 08:45:26 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.98 2003/05/10 23:12:43 thorpej Exp $");
#if defined(_KERNEL_OPT)
#include "fs_nfs.h"
@ -404,7 +404,7 @@ vndstrategy(bp)
*/
wlabel = vnd->sc_flags & (VNF_WLABEL|VNF_LABELLING);
if (DISKPART(bp->b_dev) != RAW_PART)
if (bounds_check_with_label(bp, lp, wlabel) <= 0)
if (bounds_check_with_label(&vnd->sc_dkdev, bp, wlabel) <= 0)
goto done;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.h,v 1.81 2003/05/02 08:45:24 dsl Exp $ */
/* $NetBSD: disklabel.h,v 1.82 2003/05/10 23:12:48 thorpej Exp $ */
/*
* Copyright (c) 1987, 1988, 1993
@ -492,6 +492,8 @@ struct partinfo {
#ifdef _KERNEL
struct disk;
void diskerr __P((const struct buf *, const char *, const char *, int,
int, const struct disklabel *));
u_int dkcksum __P((struct disklabel *));
@ -501,7 +503,7 @@ const char *readdisklabel __P((dev_t, void (*)(struct buf *),
struct disklabel *, struct cpu_disklabel *));
int writedisklabel __P((dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *));
int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
int bounds_check_with_label __P((struct disk *, struct buf *, int));
int bounds_check_with_mediasize __P((struct buf *, int, u_int64_t));
#endif
#endif /* _LOCORE */