summaryrefslogtreecommitdiffstats
path: root/sys/dev
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
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')
-rw-r--r--sys/dev/amr/amr_disk.c3
-rw-r--r--sys/dev/ata/ata-disk.c21
-rw-r--r--sys/dev/ata/atapi-all.c4
-rw-r--r--sys/dev/ata/atapi-cd.c19
-rw-r--r--sys/dev/ata/atapi-fd.c15
-rw-r--r--sys/dev/ata/atapi-tape.c19
-rw-r--r--sys/dev/ccd/ccd.c3
-rw-r--r--sys/dev/fdc/fdc.c6
-rw-r--r--sys/dev/ida/ida_disk.c3
-rw-r--r--sys/dev/md/md.c9
-rw-r--r--sys/dev/mlx/mlx_disk.c3
11 files changed, 30 insertions, 75 deletions
diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c
index bd9c729..f846043 100644
--- a/sys/dev/amr/amr_disk.c
+++ b/sys/dev/amr/amr_disk.c
@@ -200,8 +200,7 @@ amrd_intr(void *data)
bio->bio_resid = 0;
}
- devstat_end_transaction_bio(&sc->amrd_stats, bio);
- biodone(bio);
+ biofinish(bio, &sc->amrd_stats, 0);
}
static int
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c
index ec720cb..6d44958 100644
--- a/sys/dev/ata/ata-disk.c
+++ b/sys/dev/ata/ata-disk.c
@@ -228,15 +228,11 @@ ad_detach(struct ad_softc *adp, int flush)
if (request->device != adp)
continue;
TAILQ_REMOVE(&adp->controller->ata_queue, request, chain);
- request->bp->bio_error = ENXIO;
- request->bp->bio_flags |= BIO_ERROR;
- biodone(request->bp);
+ biofinish(request->bp, NULL, ENXIO);
ad_free(request);
}
while ((bp = bioq_first(&adp->queue))) {
- bp->bio_error = ENXIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, ENXIO);
}
disk_invalidate(&adp->disk);
disk_destroy(adp->dev);
@@ -269,9 +265,7 @@ adstrategy(struct bio *bp)
int s;
if (adp->flags & AD_F_DETACHING) {
- bp->bio_error = ENXIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, ENXIO);
return;
}
@@ -580,8 +574,7 @@ transfer_failed:
request->bp->bio_error = EIO;
request->bp->bio_flags |= BIO_ERROR;
request->bp->bio_resid = request->bytecount;
- devstat_end_transaction_bio(&adp->stats, request->bp);
- biodone(request->bp);
+ biofinish(request->bp, &adp->stats, 0);
ad_free(request);
}
ata_reinit(adp->controller);
@@ -714,8 +707,7 @@ ad_interrupt(struct ad_request *request)
}
#endif
finish:
- devstat_end_transaction_bio(&adp->stats, request->bp);
- biodone(request->bp);
+ biofinish(request->bp, &adp->stats, 0);
ad_free(request);
adp->outstanding--;
@@ -905,8 +897,7 @@ ad_timeout(struct ad_request *request)
/* retries all used up, return error */
request->bp->bio_error = EIO;
request->bp->bio_flags |= BIO_ERROR;
- devstat_end_transaction_bio(&adp->stats, request->bp);
- biodone(request->bp);
+ biofinish(request->bp, &adp->stats, 0);
ad_free(request);
}
ata_reinit(adp->controller);
diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c
index 24f4ea2..5ebc611 100644
--- a/sys/dev/ata/atapi-all.c
+++ b/sys/dev/ata/atapi-all.c
@@ -159,9 +159,7 @@ atapi_detach(struct atapi_softc *atp)
TAILQ_REMOVE(&atp->controller->atapi_queue, request, chain);
if (request->driver) {
struct bio *bp = (struct bio *) request->driver;
- bp->bio_error = ENXIO;
- bp->bio_flags |= BIO_ERROR;
- biodone(bp);
+ biofinish(bp, NULL, ENXIO);
}
if (request->dmatab)
free(request->dmatab, M_DEVBUF);
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 8af513f..4e79c74 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;
}
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;
}
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;
}
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index 6494861..4addc2e 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -1116,8 +1116,7 @@ ccdintr(cs, bp)
*/
if (bp->bio_flags & BIO_ERROR)
bp->bio_resid = bp->bio_bcount;
- devstat_end_transaction_bio(&cs->device_stats, bp);
- biodone(bp);
+ biofinish(bp, &cs->device_stats, 0);
}
/*
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 285aed8..29939cc 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -2082,8 +2082,7 @@ fdstate(fdc_p fdc)
fd->skip = 0;
fdc->bp = NULL;
device_unbusy(fd->dev);
- devstat_end_transaction_bio(&fd->device_stats, bp);
- biodone(bp);
+ biofinish(bp, &fd->device_stats, 0);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
fdc->state = FINDWORK;
@@ -2246,8 +2245,7 @@ retrier(struct fdc_data *fdc)
fdc->bp = NULL;
fdc->fd->skip = 0;
device_unbusy(fd->dev);
- devstat_end_transaction_bio(&fdc->fd->device_stats, bp);
- biodone(bp);
+ biofinish(bp, &fdc->fd->device_stats, 0);
fdc->state = FINDWORK;
fdc->flags |= FDC_NEEDS_RESET;
fdc->fd = (fd_p) 0;
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c
index 0aaeadc..99251ef 100644
--- a/sys/dev/ida/ida_disk.c
+++ b/sys/dev/ida/ida_disk.c
@@ -252,8 +252,7 @@ idad_intr(struct bio *bp)
else
bp->bio_resid = 0;
- devstat_end_transaction_bio(&drv->stats, bp);
- biodone(bp);
+ biofinish(bp, &drv->stats, 0);
}
static int
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 0d882c1..87576e7 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -304,8 +304,7 @@ mdstart_malloc(struct md_s *sc)
dst += sc->secsize;
}
bp->bio_resid = 0;
- devstat_end_transaction_bio(&sc->stats, bp);
- biodone(bp);
+ biofinish(bp, &sc->stats, 0);
}
return;
}
@@ -338,8 +337,7 @@ mdstart_preload(struct md_s *sc)
bcopy(bp->bio_data, sc->pl_ptr + (bp->bio_pblkno << DEV_BSHIFT), bp->bio_bcount);
}
bp->bio_resid = 0;
- devstat_end_transaction_bio(&sc->stats, bp);
- biodone(bp);
+ biofinish(bp, &sc->stats, 0);
}
return;
}
@@ -404,8 +402,7 @@ mdstart_vnode(struct md_s *sc)
bp->bio_error = error;
bp->bio_flags |= BIO_ERROR;
}
- devstat_end_transaction_bio(&sc->stats, bp);
- biodone(bp);
+ biofinish(bp, &sc->stats, 0);
}
return;
}
diff --git a/sys/dev/mlx/mlx_disk.c b/sys/dev/mlx/mlx_disk.c
index 365ac45..18698c2 100644
--- a/sys/dev/mlx/mlx_disk.c
+++ b/sys/dev/mlx/mlx_disk.c
@@ -212,8 +212,7 @@ mlxd_intr(void *data)
else
bp->bio_resid = 0;
- devstat_end_transaction_bio(&sc->mlxd_stats, bp);
- biodone(bp);
+ biofinish(bp, &sc->mlxd_stats, 0);
}
static int
OpenPOWER on IntegriCloud