diff options
author | phk <phk@FreeBSD.org> | 2003-10-18 17:26:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-18 17:26:13 +0000 |
commit | 94a1f5bcd66a1aa3ed05708e4f3e5ae97aa6069e (patch) | |
tree | 593463a87e834847b2c86cf517621bdcbc0fdc20 | |
parent | 466d3b80d82cce6c657cae4b6ef5eb30f678f635 (diff) | |
download | FreeBSD-src-94a1f5bcd66a1aa3ed05708e4f3e5ae97aa6069e.zip FreeBSD-src-94a1f5bcd66a1aa3ed05708e4f3e5ae97aa6069e.tar.gz |
Use bio_offset instead of bio_blkno
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 4 | ||||
-rw-r--r-- | sys/dev/ofw/ofw_disk.c | 3 | ||||
-rw-r--r-- | sys/dev/raidframe/rf_freebsdkintf.c | 14 |
3 files changed, 10 insertions, 11 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 285c221..e51a4b3 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1518,8 +1518,8 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) /* read */bp->bio_cmd == BIO_READ, /* byte2 */ 0, /* minimum_cmd_size */ 10, - /* lba */ bp->bio_blkno / - (softc->params.blksize / DEV_BSIZE), + /* lba */ bp->bio_offset / + softc->params.blksize, bp->bio_bcount / softc->params.blksize, /* data_ptr */ bp->bio_data, /* dxfer_len */ bp->bio_bcount, diff --git a/sys/dev/ofw/ofw_disk.c b/sys/dev/ofw/ofw_disk.c index 0e0614c..86ec347 100644 --- a/sys/dev/ofw/ofw_disk.c +++ b/sys/dev/ofw/ofw_disk.c @@ -98,8 +98,7 @@ ofwd_strategy(struct bio *bp) return; } - r = OF_seek(sc->ofwd_instance, - (u_quad_t)(bp->bio_blkno * OFWD_BLOCKSIZE)); + r = OF_seek(sc->ofwd_instance, bp->bio_offset); if (r == -1) { bp->bio_resid = bp->bio_bcount; device_printf(sc->ofwd_dev, "seek failed\n"); diff --git a/sys/dev/raidframe/rf_freebsdkintf.c b/sys/dev/raidframe/rf_freebsdkintf.c index 6f8802f..e417352 100644 --- a/sys/dev/raidframe/rf_freebsdkintf.c +++ b/sys/dev/raidframe/rf_freebsdkintf.c @@ -1372,15 +1372,16 @@ raidstart(raidPtr) * partition.. Need to make it absolute to the underlying * device.. */ - blocknum = bp->bio_blkno; + blocknum = bp->bio_pblkno = + bp->bio_offset >> raidPtr->logBytesPerSector; - rf_printf(3, "Blocks: %ld, %ld\n", (long)bp->bio_blkno, (long)blocknum); + rf_printf(3, "Blocks: %ld, %ld\n", (long)bp->bio_pblkno, (long)blocknum); rf_printf(3, "bp->bio_bcount = %d\n", (int) bp->bio_bcount); rf_printf(3, "bp->bio_resid = %d\n", (int) bp->bio_resid); /* *THIS* is where we adjust what block we're going to... - * but DO NOT TOUCH bp->bio_blkno!!! */ + * but DO NOT TOUCH bp->bio_pblkno!!! */ raid_addr = blocknum; num_blocks = bp->bio_bcount >> raidPtr->logBytesPerSector; @@ -1522,8 +1523,8 @@ rf_DispatchKernelIO(queue, req) queue->raidPtr->logBytesPerSector, req->b_proc); if (rf_debugKernelAccess) { - rf_printf(0, "dispatch: bp->bio_blkno = %ld\n", - (long) bp->bio_blkno); + rf_printf(0, "dispatch: bp->bio_pblkno = %ld\n", + (long) bp->bio_pblkno); } queue->numOutstanding++; queue->last_deq_sector = req->sectorOffset; @@ -1544,7 +1545,6 @@ rf_DispatchKernelIO(queue, req) raidbp->rf_buf.b_vp->v_numoutput++; } #endif - raidbp->rf_buf.b_iooffset = dbtob(raidbp->rf_buf.b_blkno); (*devsw(raidbp->rf_buf.bio_dev)->d_strategy)(&raidbp->rf_buf); break; @@ -1658,8 +1658,8 @@ InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg, bp->bio_error = 0; bp->bio_dev = dev; bp->bio_data = buf; - bp->bio_blkno = startSect; bp->bio_resid = bp->bio_bcount; /* XXX is this right!?!?!! */ + bp->bio_offset = startSect << logBytesPerSector; if (bp->bio_bcount == 0) { panic("bp->bio_bcount is zero in InitBP!!\n"); } |