summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-05-24 10:20:56 +0000
committermav <mav@FreeBSD.org>2014-05-24 10:20:56 +0000
commitf56a48e361041c76e493b4620b48d043a238489a (patch)
treea0b41fe51b26b0b2efdb7fa4bef7428d927b9020 /sys/geom
parent2751a2ff74e6238e9c0533e583e8ecb2002a10e4 (diff)
downloadFreeBSD-src-f56a48e361041c76e493b4620b48d043a238489a.zip
FreeBSD-src-f56a48e361041c76e493b4620b48d043a238489a.tar.gz
MFC r266319:
Make GEOM DISK to account also BIO_FLUSH operations.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_disk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 6e9c32b..5be9043 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -243,7 +243,7 @@ g_disk_done(struct bio *bp)
if (bp2->bio_error == 0)
bp2->bio_error = bp->bio_error;
bp2->bio_completed += bp->bio_completed;
- if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0)
+ if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0)
devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
@@ -264,7 +264,7 @@ g_disk_done_single(struct bio *bp)
bp->bio_completed = bp->bio_length - bp->bio_resid;
bp->bio_done = (void *)bp->bio_to;
bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider);
- if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) {
+ if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) {
binuptime(&now);
sc = bp->bio_to->private;
mtx_lock(&sc->done_mtx);
@@ -441,6 +441,9 @@ g_disk_start(struct bio *bp)
bp->bio_disk = dp;
bp->bio_to = (void *)bp->bio_done;
bp->bio_done = g_disk_done_single;
+ mtx_lock(&sc->start_mtx);
+ devstat_start_transaction_bio(dp->d_devstat, bp);
+ mtx_unlock(&sc->start_mtx);
g_disk_lock_giant(dp);
dp->d_strategy(bp);
g_disk_unlock_giant(dp);
OpenPOWER on IntegriCloud