Discontinue bio_blkno, use bio_offset instead.
This commit is contained in:
parent
8714e3267f
commit
583ddf14d7
@ -1779,8 +1779,8 @@ static void matcdstrategy(struct bio *bp)
|
||||
cd= &matcd_data[ldrive];
|
||||
|
||||
#ifdef DEBUGIO
|
||||
printf("matcd%d: Strategy: buf=0x%lx, block#=%lx bcount=%ld\n",
|
||||
ldrive,(unsigned long)bp,(unsigned long)bp->bio_blkno,
|
||||
printf("matcd%d: Strategy: buf=0x%lx, offset#=%jx bcount=%ld\n",
|
||||
ldrive,(unsigned long)bp,(intmax_t)bp->bio_offset,
|
||||
bp->bio_bcount);
|
||||
|
||||
|
||||
@ -1789,7 +1789,7 @@ static void matcdstrategy(struct bio *bp)
|
||||
#endif /*DEBUGIO*/
|
||||
|
||||
|
||||
if (ldrive >= TOTALDRIVES || bp->bio_blkno < 0) {
|
||||
if (ldrive >= TOTALDRIVES || bp->bio_offset < 0) {
|
||||
printf("matcd%d: Bogus parameters received - kernel may be corrupted\n",ldrive);
|
||||
bp->bio_error=EINVAL;
|
||||
goto bad;
|
||||
@ -1816,7 +1816,6 @@ static void matcdstrategy(struct bio *bp)
|
||||
}
|
||||
}
|
||||
#endif /*NOTEDIT42*/
|
||||
bp->bio_pblkno=bp->bio_blkno;
|
||||
bp->bio_resid=0;
|
||||
|
||||
s=splbio(); /*Make sure we don't get intr'ed*/
|
||||
@ -2344,11 +2343,11 @@ loop:
|
||||
mbx->skip=0;
|
||||
nextblock:
|
||||
#ifdef DEBUGIO
|
||||
printf("matcd%d: at Nextblock b_blkno %d\n",
|
||||
ldrive,(unsigned int)bp->bio_blkno);
|
||||
printf("matcd%d: at Nextblock b_offset %jd\n",
|
||||
ldrive,(intmax_t)bp->bio_offset);
|
||||
#endif /*DEBUGIO*/
|
||||
|
||||
blknum=(bp->bio_blkno/(mbx->sz/DEV_BSIZE))+
|
||||
blknum=bp->bio_offset/mbx->sz+
|
||||
mbx->p_offset+mbx->skip/mbx->sz;
|
||||
|
||||
blk_to_msf(blknum,rbuf.start_msf);
|
||||
@ -2431,8 +2430,8 @@ nextblock:
|
||||
#endif /*DEBUGIO*/
|
||||
if (status & MATCD_ST_ERROR) {
|
||||
i=get_error(port,ldrive,cdrive);
|
||||
printf("matcd%d: %s while reading block %d [Soft]\n",
|
||||
ldrive,matcderrors[i],(int)bp->bio_blkno);
|
||||
printf("matcd%d: %s while reading offset %jd [Soft]\n",
|
||||
ldrive,matcderrors[i],(intmax_t)bp->bio_offset);
|
||||
media_chk(cd,i,ldrive,0);/*<14>was wrong place*/
|
||||
}
|
||||
|
||||
@ -2463,8 +2462,8 @@ nextblock:
|
||||
*/
|
||||
|
||||
errtyp=get_error(port,ldrive,cdrive);
|
||||
printf("matcd%d: %s while reading block %d\n",
|
||||
ldrive,matcderrors[errtyp],(int)bp->bio_blkno);
|
||||
printf("matcd%d: %s while reading offset %jd\n",
|
||||
ldrive,matcderrors[errtyp],(intmax_t)bp->bio_offset);
|
||||
|
||||
if (media_chk(cd,errtyp,ldrive,0)==0) {
|
||||
errtyp=chk_error(errtyp);
|
||||
|
@ -297,18 +297,6 @@ mcdstrategy(struct bio *bp)
|
||||
|
||||
sc = (struct mcd_softc *)bp->bio_dev->si_drv1;
|
||||
|
||||
/* test validity */
|
||||
/*MCD_TRACE("strategy: buf=0x%lx, unit=%ld, block#=%ld bcount=%ld\n",
|
||||
bp,unit,bp->bio_blkno,bp->bio_bcount);*/
|
||||
|
||||
if (bp->bio_blkno < 0) {
|
||||
device_printf(sc->dev, "strategy failure: blkno = %ld, bcount = %ld\n",
|
||||
(long)bp->bio_blkno, bp->bio_bcount);
|
||||
bp->bio_error = EINVAL;
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* if device invalidated (e.g. media change, door open), error */
|
||||
if (!(sc->data.flags & MCDVALID)) {
|
||||
device_printf(sc->dev, "media changed\n");
|
||||
@ -331,7 +319,6 @@ mcdstrategy(struct bio *bp)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
bp->bio_pblkno = bp->bio_blkno;
|
||||
bp->bio_resid = 0;
|
||||
|
||||
/* queue it */
|
||||
@ -892,8 +879,7 @@ modedone:
|
||||
mbx->skip = 0;
|
||||
|
||||
nextblock:
|
||||
blknum = (bp->bio_blkno / (mbx->sz/DEV_BSIZE))
|
||||
+ mbx->skip/mbx->sz;
|
||||
blknum = bp->bio_offset / mbx->sz + mbx->skip/mbx->sz;
|
||||
|
||||
MCD_TRACE("mcd_doread: read blknum=%d for bp=%p\n",
|
||||
blknum, bp);
|
||||
|
@ -255,17 +255,6 @@ scdstrategy(struct bio *bp)
|
||||
|
||||
sc = (struct scd_softc *)bp->bio_dev->si_drv1;
|
||||
|
||||
XDEBUG(sc, 2, "DEBUG: strategy: block=%ld, bcount=%ld\n",
|
||||
(long)bp->bio_blkno, bp->bio_bcount);
|
||||
|
||||
if (bp->bio_blkno < 0 || (bp->bio_bcount % SCDBLKSIZE)) {
|
||||
device_printf(sc->dev, "strategy failure: blkno = %ld, bcount = %ld\n",
|
||||
(long)bp->bio_blkno, bp->bio_bcount);
|
||||
bp->bio_error = EINVAL;
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* if device invalidated (e.g. media change, door open), error */
|
||||
if (!(sc->data.flags & SCDVALID)) {
|
||||
device_printf(sc->dev, "media changed\n");
|
||||
@ -288,7 +277,6 @@ scdstrategy(struct bio *bp)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
bp->bio_pblkno = bp->bio_blkno;
|
||||
bp->bio_resid = 0;
|
||||
|
||||
/* queue it */
|
||||
@ -749,8 +737,7 @@ nextblock:
|
||||
if (!(sc->data.flags & SCDVALID))
|
||||
goto changed;
|
||||
|
||||
blknum = (bp->bio_blkno / (mbx->sz/DEV_BSIZE))
|
||||
+ mbx->skip/mbx->sz;
|
||||
blknum = bp->bio_offset / mbx->sz + mbx->skip/mbx->sz;
|
||||
|
||||
XDEBUG(sc, 2, "scd_doread: read blknum=%d\n", blknum);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user