diff options
author | phk <phk@FreeBSD.org> | 2000-04-15 05:54:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-04-15 05:54:02 +0000 |
commit | aaaef0b54e307450b19dcd1fb6ec921cc62d1acf (patch) | |
tree | 175dac1aaf0d06b54deb889161091dbcf88c79c6 /sys/alpha | |
parent | f2310ef109eccf99c872f4f90eb70f4fc26e39f1 (diff) | |
download | FreeBSD-src-aaaef0b54e307450b19dcd1fb6ec921cc62d1acf.zip FreeBSD-src-aaaef0b54e307450b19dcd1fb6ec921cc62d1acf.tar.gz |
Complete the bio/buf divorce for all code below devfs::strategy
Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.
CCD not converted yet, casts to struct buf (still safe)
atapi-cd casts to struct buf to examine B_PHYS
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/machdep.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index c5c6ad7..055f652 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -1919,55 +1919,55 @@ Debugger(const char *msg) * 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 bio *bp, struct disklabel *lp, int wlabel) { #if 0 - struct partition *p = lp->d_partitions + dkpart(bp->b_dev); + struct partition *p = lp->d_partitions + dkpart(bp->bio_dev); int labelsect = lp->d_partitions[0].p_offset; int maxsz = p->p_size, - sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; + sz = (bp->bio_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; /* overwriting disk label ? */ /* XXX should also protect bootstrap in first 8K */ - if (bp->b_blkno + p->p_offset <= LABELSECTOR + labelsect && + if (bp->bio_blkno + p->p_offset <= LABELSECTOR + labelsect && #if LABELSECTOR != 0 - bp->b_blkno + p->p_offset + sz > LABELSECTOR + labelsect && + bp->bio_blkno + p->p_offset + sz > LABELSECTOR + labelsect && #endif - (bp->b_iocmd == BIO_WRITE) && wlabel == 0) { - bp->b_error = EROFS; + (bp->bio_cmd == BIO_WRITE) && wlabel == 0) { + bp->bio_error = EROFS; goto bad; } #if defined(DOSBBSECTOR) && defined(notyet) /* overwriting master boot record? */ - if (bp->b_blkno + p->p_offset <= DOSBBSECTOR && - (bp->b_iocmd == BIO_WRITE) && wlabel == 0) { - bp->b_error = EROFS; + if (bp->bio_blkno + p->p_offset <= DOSBBSECTOR && + (bp->bio_cmd == BIO_WRITE) && wlabel == 0) { + bp->bio_error = EROFS; goto bad; } #endif /* beyond partition? */ - if (bp->b_blkno < 0 || bp->b_blkno + sz > maxsz) { + if (bp->bio_blkno < 0 || bp->bio_blkno + sz > maxsz) { /* if exactly at end of disk, return an EOF */ - if (bp->b_blkno == maxsz) { - bp->b_resid = bp->b_bcount; + if (bp->bio_blkno == maxsz) { + bp->bio_resid = bp->bio_bcount; return(0); } /* or truncate if part of it fits */ - sz = maxsz - bp->b_blkno; + sz = maxsz - bp->bio_blkno; if (sz <= 0) { - bp->b_error = EINVAL; + bp->bio_error = EINVAL; goto bad; } - bp->b_bcount = sz << DEV_BSHIFT; + bp->bio_bcount = sz << DEV_BSHIFT; } - bp->b_pblkno = bp->b_blkno + p->p_offset; + bp->bio_pblkno = bp->bio_blkno + p->p_offset; return(1); bad: - bp->b_ioflags |= BIO_ERROR; + bp->bio_flags |= BIO_ERROR; #endif return(-1); |