mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-21 15:45:02 +00:00
Rearrange the call to disk_destroy.
Suggested by: phk
This commit is contained in:
parent
db575a8507
commit
71d7101fac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134375
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user