diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-03-15 10:49:26 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-03-15 10:49:26 +0000 |
commit | 81876757ecdf594d8562842ccb5541fe11f819b9 (patch) | |
tree | e50aace47e628c54e4a323c368da940f60658401 /sys/geom/geom_disk.c | |
parent | 9fa85de269ef3efdd5272b82f0926c6ee9b796ef (diff) | |
download | src-81876757ecdf594d8562842ccb5541fe11f819b9.tar.gz src-81876757ecdf594d8562842ccb5541fe11f819b9.zip |
Use devstat_{start,end}_transaction_bio().
Remember to set bio_resid correctly first.
Notes
Notes:
svn path=/head/; revision=112259
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r-- | sys/geom/geom_disk.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index bed4f6e2d5bd..5c3a57b7d14f 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; |