diff options
author | phk <phk@FreeBSD.org> | 2001-05-06 21:55:22 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-05-06 21:55:22 +0000 |
commit | d95099399d37a681fda4dff26bc0631ea5b988e3 (patch) | |
tree | 7a8b40ff50afe0d7cc1aee2b928221f4ded19339 | |
parent | a1f1a879b581a842e4c34c578b4503b28a6e5ff0 (diff) | |
download | FreeBSD-src-d95099399d37a681fda4dff26bc0631ea5b988e3.zip FreeBSD-src-d95099399d37a681fda4dff26bc0631ea5b988e3.tar.gz |
Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.
-rw-r--r-- | sys/dev/aac/aac_disk.c | 7 | ||||
-rw-r--r-- | sys/dev/amr/amr_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 7 | ||||
-rw-r--r-- | sys/dev/ata/ata-raid.c | 7 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 7 | ||||
-rw-r--r-- | sys/dev/ida/ida_disk.c | 6 | ||||
-rw-r--r-- | sys/dev/mlx/mlx_disk.c | 4 | ||||
-rw-r--r-- | sys/dev/twe/twe_freebsd.c | 8 | ||||
-rw-r--r-- | sys/kern/subr_disk.c | 6 |
9 files changed, 6 insertions, 50 deletions
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c index 09bd971..564f79e 100644 --- a/sys/dev/aac/aac_disk.c +++ b/sys/dev/aac/aac_disk.c @@ -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); diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c index f846043..de703fe 100644 --- a/sys/dev/amr/amr_disk.c +++ b/sys/dev/amr/amr_disk.c @@ -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; diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 6d44958..d4a2b9c 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -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); diff --git a/sys/dev/ata/ata-raid.c b/sys/dev/ata/ata-raid.c index 30cbd76..546b998 100644 --- a/sys/dev/ata/ata-raid.c +++ b/sys/dev/ata/ata-raid.c @@ -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; diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index a831ff4..a419d2b 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -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); diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index 99251ef..4bf662c 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -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); diff --git a/sys/dev/mlx/mlx_disk.c b/sys/dev/mlx/mlx_disk.c index 18698c2..b372247 100644 --- a/sys/dev/mlx/mlx_disk.c +++ b/sys/dev/mlx/mlx_disk.c @@ -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; diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c index 15c5574..677e7af 100644 --- a/sys/dev/twe/twe_freebsd.c +++ b/sys/dev/twe/twe_freebsd.c @@ -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); diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index b4932cb..aaa28c8 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -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); |