Skip to content

Commit 2ee73ef

Browse files
Mikulas PatockaMike Snitzer
authored andcommitted
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: e3a35d0 ("dm writecache: add event counters") Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent b2676e1 commit 2ee73ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/admin-guide/device-mapper/writecache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Status:
8989
11. the number of write blocks that are allocated in the cache
9090
12. the number of write requests that are blocked on the freelist
9191
13. the number of flush requests
92-
14. the number of discard requests
92+
14. the number of discarded blocks
9393

9494
Messages:
9595
flush

drivers/md/dm-writecache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ static enum wc_map_op writecache_map_flush(struct dm_writecache *wc, struct bio
15141514

15151515
static enum wc_map_op writecache_map_discard(struct dm_writecache *wc, struct bio *bio)
15161516
{
1517-
wc->stats.discards++;
1517+
wc->stats.discards += bio->bi_iter.bi_size >> wc->block_size_bits;
15181518

15191519
if (writecache_has_error(wc))
15201520
return WC_MAP_ERROR;

0 commit comments

Comments
 (0)