diff options
author | mav <mav@FreeBSD.org> | 2014-05-17 15:07:00 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-05-17 15:07:00 +0000 |
commit | b0e1e69974fc28360edef75382b3fb857a4b3f89 (patch) | |
tree | cd76b90acd0c025d82abf4f341030bfa5404d8dc | |
parent | 0d8667cce012a25672f25c7f83b5b819f42c6a88 (diff) | |
download | FreeBSD-src-b0e1e69974fc28360edef75382b3fb857a4b3f89.zip FreeBSD-src-b0e1e69974fc28360edef75382b3fb857a4b3f89.tar.gz |
Make GEOM DISK to account also BIO_FLUSH operations.
-rw-r--r-- | sys/geom/geom_disk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index f2181ba..eb72597 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -223,7 +223,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) { @@ -244,7 +244,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); @@ -418,6 +418,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); dp->d_strategy(bp); break; default: |