diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2022-07-11 23:31:52 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-07-14 22:54:46 +0300 |
commit | 2ee73ef60db4d79b9f9b8cd501e8188b5179449f (patch) | |
tree | d69a777e5e2d218fe96334f1b00233ea808c88d9 /drivers/md | |
parent | b2676e1482af89714af6988ce5d31a84692e2530 (diff) | |
download | linux-2ee73ef60db4d79b9f9b8cd501e8188b5179449f.tar.xz |
dm writecache: count number of blocks discarded, not number of discard bios
Change dm-writecache, so that it counts the number of blocks discarded
instead of the number of discard bios. Make it consistent with the
read and write statistics counters that were changed to count the
number of blocks instead of bios.
Fixes: e3a35d03407c ("dm writecache: add event counters")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-writecache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 6282c77abe7b..ead008ea38f2 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1514,7 +1514,7 @@ static enum wc_map_op writecache_map_flush(struct dm_writecache *wc, struct bio static enum wc_map_op writecache_map_discard(struct dm_writecache *wc, struct bio *bio) { - wc->stats.discards++; + wc->stats.discards += bio->bi_iter.bi_size >> wc->block_size_bits; if (writecache_has_error(wc)) return WC_MAP_ERROR; |