summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-08-26 15:44:20 +0800
committerSong Liu <song@kernel.org>2024-08-27 10:14:15 -0700
commit27832ad3f7f0f5080d472fa8621ff92166ca9fac (patch)
tree868e73a7f4737c8b449b26f624e83c3980e994ef /drivers/md/md-bitmap.c
parent9e4481ce0e55b4ef9795845d8b6770e3f6f4b24d (diff)
md/md-bitmap: add a new helper md_bitmap_set_pages()
Currently md-cluster will set bitmap->counts.pages directly, add a helper to do this to avoid dereferencing bitmap directly. Noted that after this patch bitmap is not dereferenced directly anymore and following patches will move the structure inside md-bitmap.c. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240826074452.1490072-11-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 918510f36e33..015997b4b835 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2094,6 +2094,12 @@ int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
}
EXPORT_SYMBOL_GPL(md_bitmap_copy_from_slot);
+void md_bitmap_set_pages(struct bitmap *bitmap, unsigned long pages)
+{
+ bitmap->counts.pages = pages;
+}
+EXPORT_SYMBOL_GPL(md_bitmap_set_pages);
+
int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
{
struct bitmap_storage *storage;