summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-08-26 10:44:14 +0300
committerSong Liu <song@kernel.org>2024-08-27 20:14:14 +0300
commitd004442f46ccae9ea90fdda7a2b0516f1d42b88e (patch)
tree4d9746e8ec168b1ab882dc3fd8e1f984f5de5991 /drivers/md/md-bitmap.c
parent968153812215d68c27c0c9d90da6ec2f6d17a606 (diff)
downloadlinux-d004442f46ccae9ea90fdda7a2b0516f1d42b88e.tar.xz
md/md-bitmap: add 'events_cleared' into struct md_bitmap_stats
Also add a new helper to get events_cleared to avoid dereferencing bitmap directly to prepare inventing a new bitmap. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240826074452.1490072-5-yukuai1@huaweicloud.com Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md-bitmap.c')
-rw-r--r--drivers/md/md-bitmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 66ebe12d80ae..95afc22bd255 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2104,6 +2104,8 @@ int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
counts = &bitmap->counts;
stats->missing_pages = counts->missing_pages;
stats->pages = counts->pages;
+
+ stats->events_cleared = bitmap->events_cleared;
stats->file = bitmap->storage.file;
return 0;