summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cd.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-01 15:06:26 +0000
committerphk <phk@FreeBSD.org>2003-04-01 15:06:26 +0000
commitc235e25328c6cf4b9091f38d9c18db15764df594 (patch)
treef08dda1f60d395e9bc94bf2fd1921768bf958c6d /sys/dev/ata/atapi-cd.c
parent98acc8a3d79206dbf51e83ae8573fa89e54645b6 (diff)
downloadFreeBSD-src-c235e25328c6cf4b9091f38d9c18db15764df594.zip
FreeBSD-src-c235e25328c6cf4b9091f38d9c18db15764df594.tar.gz
Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
-rw-r--r--sys/dev/ata/atapi-cd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 8e0d5bc..751a2c4 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -193,17 +193,13 @@ acddetach(struct ata_device *atadev)
{
struct acd_softc *cdp = atadev->driver;
struct acd_devlist *entry;
- struct bio *bp;
int subdev;
if (cdp->changer_info) {
for (subdev = 0; subdev < cdp->changer_info->slots; subdev++) {
if (cdp->driver[subdev] == cdp)
continue;
- while ((bp = bioq_first(&cdp->driver[subdev]->queue))) {
- bioq_remove(&cdp->driver[subdev]->queue, bp);
- biofinish(bp, NULL, ENXIO);
- }
+ bioq_flush(&cdp->driver[subdev]->queue, NULL, ENXIO);
destroy_dev(cdp->driver[subdev]->dev);
while ((entry = TAILQ_FIRST(&cdp->driver[subdev]->dev_list))) {
destroy_dev(entry->dev);
@@ -217,8 +213,7 @@ acddetach(struct ata_device *atadev)
free(cdp->driver, M_ACD);
free(cdp->changer_info, M_ACD);
}
- while ((bp = bioq_first(&cdp->queue)))
- biofinish(bp, NULL, ENXIO);
+ bioq_flush(&cdp->queue, NULL, ENXIO);
while ((entry = TAILQ_FIRST(&cdp->dev_list))) {
destroy_dev(entry->dev);
TAILQ_REMOVE(&cdp->dev_list, entry, chain);
@@ -1100,7 +1095,7 @@ acdstrategy(struct bio *bp)
bp->bio_resid = bp->bio_bcount;
s = splbio();
- bioqdisksort(&cdp->queue, bp);
+ bioq_disksort(&cdp->queue, bp);
splx(s);
ata_start(cdp->device->channel);
}
OpenPOWER on IntegriCloud