summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-03-15 10:49:26 +0000
committerphk <phk@FreeBSD.org>2003-03-15 10:49:26 +0000
commit0e540e1b29ca198f58e003442d26e3c285ef5483 (patch)
treee50aace47e628c54e4a323c368da940f60658401 /sys/geom/geom_disk.c
parent4a623e073c76d51c33a3f7474b38c023fd3efe0b (diff)
downloadFreeBSD-src-0e540e1b29ca198f58e003442d26e3c285ef5483.zip
FreeBSD-src-0e540e1b29ca198f58e003442d26e3c285ef5483.tar.gz
Use devstat_{start,end}_transaction_bio().
Remember to set bio_resid correctly first.
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index bed4f6e..5c3a57b 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -164,7 +164,6 @@ g_disk_done(struct bio *bp)
{
struct bio *bp2;
struct disk *dp;
- devstat_trans_flags flg;
/* See "notes" for why we need a mutex here */
/* XXX: will witness accept a mix of Giant/unGiant drivers here ? */
@@ -179,14 +178,8 @@ g_disk_done(struct bio *bp)
g_destroy_bio(bp);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
- if (bp2->bio_cmd == BIO_DELETE)
- flg = DEVSTAT_FREE;
- else if (bp2->bio_cmd == BIO_READ)
- flg = DEVSTAT_READ;
- else
- flg = DEVSTAT_WRITE;
- devstat_end_transaction(dp->d_devstat, bp2->bio_completed,
- DEVSTAT_TAG_SIMPLE, flg);
+ bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
+ devstat_end_transaction_bio(dp->d_devstat, bp2);
g_io_deliver(bp2, bp2->bio_error);
}
mtx_unlock(&g_disk_done_mtx);
@@ -219,7 +212,7 @@ g_disk_start(struct bio *bp)
error = ENOMEM;
break;
}
- devstat_start_transaction(dp->d_devstat);
+ devstat_start_transaction_bio(dp->d_devstat, bp);
do {
bp2->bio_offset += off;
bp2->bio_length -= off;
OpenPOWER on IntegriCloud