mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-28 05:24:47 +08:00
dm writecache: count number of blocks discarded, not number of discard bios
[ Upstream commit2ee73ef60d
] 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:e3a35d0340
("dm writecache: add event counters") Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fc988f1ca2
commit
a638fa9745
@ -87,7 +87,7 @@ Status:
|
||||
11. the number of write blocks that are allocated in the cache
|
||||
12. the number of write requests that are blocked on the freelist
|
||||
13. the number of flush requests
|
||||
14. the number of discard requests
|
||||
14. the number of discarded blocks
|
||||
|
||||
Messages:
|
||||
flush
|
||||
|
@ -1513,7 +1513,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;
|
||||
|
Loading…
Reference in New Issue
Block a user