summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-tape.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-05-06 20:00:03 +0000
committerphk <phk@FreeBSD.org>2001-05-06 20:00:03 +0000
commit16caeec9b02aa3b15073b68736e4e950266ffd81 (patch)
tree530c90a78ebb64a793fe1f7688a50c3a46c4eba9 /sys/dev/ata/atapi-tape.c
parent33cb778d44db479f7586e1b5c1f9b400db720f22 (diff)
downloadFreeBSD-src-16caeec9b02aa3b15073b68736e4e950266ffd81.zip
FreeBSD-src-16caeec9b02aa3b15073b68736e4e950266ffd81.tar.gz
Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror(). Most of this patch is generated by scripts.
Diffstat (limited to 'sys/dev/ata/atapi-tape.c')
-rw-r--r--sys/dev/ata/atapi-tape.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c
index a5f3f42..fb02a1f 100644
--- a/sys/dev/ata/atapi-tape.c
+++ b/sys/dev/ata/atapi-tape.c
@@ -159,9 +159,7 @@ astdetach(struct atapi_softc *atp)
struct bio *bp;
while ((bp = bioq_first(&stp->queue))) {
- bp->bio_error = ENXIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, ENXIO);
}
destroy_dev(stp->dev1);
destroy_dev(stp->dev2);
@@ -430,9 +428,7 @@ aststrategy(struct bio *bp)
int s;
if (stp->atp->flags & ATAPI_F_DETACHING) {
- bp->bio_error = ENXIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, ENXIO);
return;
}
@@ -443,9 +439,7 @@ aststrategy(struct bio *bp)
return;
}
if (!(bp->bio_cmd == BIO_READ) && stp->flags & F_WRITEPROTECT) {
- bp->bio_error = EPERM;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, EPERM);
return;
}
@@ -453,9 +447,7 @@ aststrategy(struct bio *bp)
if (bp->bio_bcount % stp->blksize) {
ata_printf(stp->atp->controller, stp->atp->unit,
"bad request, must be multiple of %d\n", stp->blksize);
- bp->bio_error = EIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, EIO);
return;
}
@@ -524,8 +516,7 @@ ast_done(struct atapi_request *request)
bp->bio_resid = bp->bio_bcount - request->donecount;
ast_total += (bp->bio_bcount - bp->bio_resid);
}
- devstat_end_transaction_bio(&stp->stats, bp);
- biodone(bp);
+ biofinish(bp, &stp->stats, 0);
return 0;
}
OpenPOWER on IntegriCloud