Make the disk mini-layer check for and handle zero-length transfers

instead of the underlying drivers.
This commit is contained in:
Poul-Henning Kamp 2001-05-06 21:55:22 +00:00
parent 87406f5cb4
commit 079f2df393
9 changed files with 6 additions and 50 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);