From 16caeec9b02aa3b15073b68736e4e950266ffd81 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 6 May 2001 20:00:03 +0000 Subject: Actually biofinish(struct bio *, struct devstat *, int error) is more general than the bioerror(). Most of this patch is generated by scripts. --- sys/dev/ata/atapi-fd.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sys/dev/ata/atapi-fd.c') diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 6905a29..a831ff4 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -127,9 +127,7 @@ afddetach(struct atapi_softc *atp) struct bio *bp; while ((bp = bioq_first(&fdp->queue))) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, ENXIO); } disk_invalidate(&fdp->disk); disk_destroy(fdp->dev); @@ -305,9 +303,7 @@ afdstrategy(struct bio *bp) int s; if (fdp->atp->flags & ATAPI_F_DETACHING) { - bp->bio_error = ENXIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, ENXIO); return; } @@ -341,9 +337,7 @@ afd_start(struct atapi_softc *atp) /* should reject all queued entries if media have changed. */ if (fdp->atp->flags & ATAPI_F_MEDIA_CHANGED) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - biodone(bp); + biofinish(bp, NULL, EIO); return; } @@ -416,8 +410,7 @@ afd_done(struct atapi_request *request) } else bp->bio_resid += (bp->bio_bcount - request->donecount); - devstat_end_transaction_bio(&fdp->stats, bp); - biodone(bp); + biofinish(bp, &fdp->stats, 0); return 0; } -- cgit v1.1