diff options
author | sos <sos@FreeBSD.org> | 2004-08-27 12:03:18 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2004-08-27 12:03:18 +0000 |
commit | d8df060fde1db43bb50be8497449a99722e8c708 (patch) | |
tree | f4b1d15f76b6556f51d77f955a6864523d2b29cd /sys/dev/ata | |
parent | aabb7d1fb442b1e0a63a48742ab225da7386c8ff (diff) | |
download | FreeBSD-src-d8df060fde1db43bb50be8497449a99722e8c708.zip FreeBSD-src-d8df060fde1db43bb50be8497449a99722e8c708.tar.gz |
Rearrange the call to disk_destroy.
Suggested by: phk
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 9007d3b..a6dfb3a 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -164,12 +164,12 @@ ad_detach(struct ata_device *atadev) if (adp->flags & AD_F_RAID_SUBDISK) ata_raiddisk_detach(adp); #endif + disk_destroy(adp->disk); + ata_prtdev(atadev, "WARNING - removed from configuration\n"); mtx_lock(&adp->queue_mtx); bioq_flush(&adp->queue, NULL, ENXIO); mtx_unlock(&adp->queue_mtx); mtx_destroy(&adp->queue_mtx); - disk_destroy(adp->disk); - ata_prtdev(atadev, "WARNING - removed from configuration\n"); ata_free_name(atadev); ata_free_lun(&adp_lun_map, adp->lun); atadev->attach = NULL; @@ -219,10 +219,6 @@ adstrategy(struct bio *bp) { struct ad_softc *adp = bp->bio_disk->d_drv1; - if (adp->device->flags & ATA_D_DETACHING) { - biofinish(bp, NULL, ENXIO); - return; - } mtx_lock(&adp->queue_mtx); bioq_disksort(&adp->queue, bp); mtx_unlock(&adp->queue_mtx); @@ -245,6 +241,10 @@ ad_start(struct ata_device *atadev) } bioq_remove(&adp->queue, bp); mtx_unlock(&adp->queue_mtx); + if (adp->device->flags & ATA_D_DETACHING) { + biofinish(bp, NULL, ENXIO); + return; + } if (!(request = ata_alloc_request())) { ata_prtdev(atadev, "FAILURE - out of memory in start\n"); |