summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 53c8c15..42c40bc 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -202,12 +202,12 @@ g_disk_done(struct bio *bp)
if (bp2->bio_error == 0)
bp2->bio_error = bp->bio_error;
bp2->bio_completed += bp->bio_completed;
+ if ((dp = bp2->bio_to->geom->softc))
+ devstat_end_transaction_bio(dp->d_devstat, bp);
g_destroy_bio(bp);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
- if ((dp = bp2->bio_to->geom->softc))
- devstat_end_transaction_bio(dp->d_devstat, bp2);
g_io_deliver(bp2, bp2->bio_error);
}
mtx_unlock(&g_disk_done_mtx);
@@ -261,7 +261,6 @@ g_disk_start(struct bio *bp)
error = ENOMEM;
break;
}
- devstat_start_transaction_bio(dp->d_devstat, bp);
do {
bp2->bio_offset += off;
bp2->bio_length -= off;
@@ -285,6 +284,7 @@ g_disk_start(struct bio *bp)
bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize;
bp2->bio_bcount = bp2->bio_length;
bp2->bio_disk = dp;
+ devstat_start_transaction_bio(dp->d_devstat, bp2);
g_disk_lock_giant(dp);
dp->d_strategy(bp2);
g_disk_unlock_giant(dp);
OpenPOWER on IntegriCloud