Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.
This commit is contained in:
parent
87406f5cb4
commit
079f2df393
@ -168,13 +168,6 @@ aac_disk_strategy(struct bio *bp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* do-nothing operation? */
|
||||
if (bp->bio_bcount == 0) {
|
||||
bp->bio_resid = bp->bio_bcount;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
/* perform accounting */
|
||||
devstat_start_transaction(&sc->ad_stats);
|
||||
|
||||
|
@ -165,10 +165,6 @@ amrd_strategy(struct bio *bio)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* do-nothing operation */
|
||||
if (bio->bio_bcount == 0)
|
||||
goto done;
|
||||
|
||||
devstat_start_transaction(&sc->amrd_stats);
|
||||
amr_submit_bio(sc->amrd_controller, bio);
|
||||
return;
|
||||
|
@ -269,13 +269,6 @@ adstrategy(struct bio *bp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->bio_bcount == 0) {
|
||||
bp->bio_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
s = splbio();
|
||||
bioqdisksort(&adp->queue, bp);
|
||||
ata_start(adp->controller);
|
||||
|
@ -158,13 +158,6 @@ arstrategy(struct bio *bp)
|
||||
int lba, count, chunk;
|
||||
caddr_t data;
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->bio_bcount == 0) {
|
||||
bp->bio_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
bp->bio_resid = bp->bio_bcount;
|
||||
lba = bp->bio_pblkno;
|
||||
data = bp->bio_data;
|
||||
|
@ -307,13 +307,6 @@ afdstrategy(struct bio *bp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->bio_bcount == 0) {
|
||||
bp->bio_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
s = splbio();
|
||||
bioqdisksort(&fdp->queue, bp);
|
||||
ata_start(fdp->atp->controller);
|
||||
|
@ -169,12 +169,6 @@ idad_strategy(struct bio *bp)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/*
|
||||
* If it's a null transfer, return immediately
|
||||
*/
|
||||
if (bp->bio_bcount == 0)
|
||||
goto done;
|
||||
|
||||
bp->bio_driver1 = drv;
|
||||
s = splbio();
|
||||
devstat_start_transaction(&drv->stats);
|
||||
|
@ -179,10 +179,6 @@ mlxd_strategy(struct bio *bp)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* do-nothing operation */
|
||||
if (bp->bio_bcount == 0)
|
||||
goto done;
|
||||
|
||||
devstat_start_transaction(&sc->mlxd_stats);
|
||||
mlx_submit_buf(sc->mlxd_controller, bp);
|
||||
return;
|
||||
|
@ -668,14 +668,6 @@ twed_strategy(twe_bio *bp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* do-nothing operation? */
|
||||
if (TWE_BIO_LENGTH(bp) == 0) {
|
||||
TWE_BIO_RESID(bp) = 0;
|
||||
TWE_BIO_DONE(bp);
|
||||
TWED_BIO_OUT;
|
||||
return;
|
||||
}
|
||||
|
||||
/* perform accounting */
|
||||
TWE_BIO_STATS_START(bp);
|
||||
|
||||
|
@ -309,6 +309,12 @@ diskstrategy(struct bio *bp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (bp->bio_bcount == 0) {
|
||||
bp->bio_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
KASSERT(dp->d_devsw != NULL, ("NULL devsw"));
|
||||
KASSERT(dp->d_devsw->d_strategy != NULL, ("NULL d_strategy"));
|
||||
dp->d_devsw->d_strategy(bp);
|
||||
|
Loading…
Reference in New Issue
Block a user