summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.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/ata-disk.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/ata-disk.c')
-rw-r--r--sys/dev/ata/ata-disk.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index c7d80cb..9801c25 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -45,6 +45,7 @@
#include <machine/md_var.h>
#include <machine/bus.h>
#include <sys/rman.h>
+#include <geom/geom_disk.h>
#include <dev/ata/ata-all.h>
#include <dev/ata/ata-pci.h>
#include <dev/ata/ata-disk.h>
@@ -217,7 +218,6 @@ ad_detach(struct ata_device *atadev, int flush) /* get rid of flush XXX SOS */
{
struct ad_softc *adp = atadev->driver;
struct ad_request *request;
- struct bio *bp;
atadev->flags |= ATA_D_DETACHING;
ata_prtdev(atadev, "removed from configuration\n");
@@ -229,10 +229,7 @@ ad_detach(struct ata_device *atadev, int flush) /* get rid of flush XXX SOS */
biofinish(request->bp, NULL, ENXIO);
ad_free(request);
}
- while ((bp = bioq_first(&adp->queue))) {
- bioq_remove(&adp->queue, bp);
- biofinish(bp, NULL, ENXIO);
- }
+ bioq_flush(&adp->queue, NULL, ENXIO);
disk_destroy(&adp->disk);
if (adp->flags & AD_F_RAID_SUBDISK)
@@ -288,7 +285,7 @@ adstrategy(struct bio *bp)
return;
}
s = splbio();
- bioqdisksort(&adp->queue, bp);
+ bioq_disksort(&adp->queue, bp);
splx(s);
ata_start(adp->device->channel);
}
OpenPOWER on IntegriCloud