diff options
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
| -rw-r--r-- | sys/dev/ata/atapi-cd.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 8af513f092aef..4e79c74671731 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -200,9 +200,7 @@ acddetach(struct atapi_softc *atp) if (cdp->driver[subdev] == cdp) continue; while ((bp = bioq_first(&cdp->driver[subdev]->queue))) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, ENXIO); } destroy_dev(cdp->driver[subdev]->dev1); destroy_dev(cdp->driver[subdev]->dev2); @@ -220,9 +218,7 @@ acddetach(struct atapi_softc *atp) free(cdp->changer_info, M_ACD); } while ((bp = bioq_first(&cdp->queue))) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, ENXIO); } destroy_dev(cdp->dev1); destroy_dev(cdp->dev2); @@ -1061,9 +1057,7 @@ acdstrategy(struct bio *bp) int s; if (cdp->atp->flags & ATAPI_F_DETACHING) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, ENXIO); return; } @@ -1116,9 +1110,7 @@ acd_start(struct atapi_softc *atp) /* reject all queued entries if media changed */ if (cdp->atp->flags & ATAPI_F_MEDIA_CHANGED) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, EIO); return; } @@ -1194,8 +1186,7 @@ acd_done(struct atapi_request *request) } else bp->bio_resid = bp->bio_bcount - request->donecount; - devstat_end_transaction_bio(cdp->stats, bp); - biodone(bp); + biofinish(bp, cdp->stats, 0); return 0; } |
