summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-08-26 15:44:16 +0800
committerSong Liu <song@kernel.org>2024-08-27 10:14:15 -0700
commitec6bb299c7c3dd4ca1724d13d5f5fae3ee54fc65 (patch)
tree01c310778a0fa5ee221708e9f7fac84c4677b327 /drivers/md/md-bitmap.c
parent82697ccf7e495c1ba81e315c2886d6220ff84c2c (diff)
downloadlwn-ec6bb299c7c3dd4ca1724d13d5f5fae3ee54fc65.tar.gz
lwn-ec6bb299c7c3dd4ca1724d13d5f5fae3ee54fc65.zip
md/md-bitmap: add 'sync_size' into struct md_bitmap_stats
To avoid dereferencing bitmap directly in md-cluster to prepare inventing a new bitmap. BTW, also fix following checkpatch warnings: WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead WARNING: Deprecated use of 'kunmap_atomic', prefer 'kunmap_local' instead Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240826074452.1490072-7-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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 95afc22bd255..33812543d984 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2097,10 +2097,15 @@ EXPORT_SYMBOL_GPL(md_bitmap_copy_from_slot);
int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
{
struct bitmap_counts *counts;
+ bitmap_super_t *sb;
if (!bitmap)
return -ENOENT;
+ sb = kmap_local_page(bitmap->storage.sb_page);
+ stats->sync_size = le64_to_cpu(sb->sync_size);
+ kunmap_local(sb);
+
counts = &bitmap->counts;
stats->missing_pages = counts->missing_pages;
stats->pages = counts->pages;
@@ -2110,6 +2115,7 @@ int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
return 0;
}
+EXPORT_SYMBOL_GPL(md_bitmap_get_stats);
int md_bitmap_resize(struct bitmap *bitmap, sector_t blocks,
int chunksize, int init)