summaryrefslogtreecommitdiff
path: root/drivers/md/md-bitmap.h
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-08-26 10:44:12 +0300
committerSong Liu <song@kernel.org>2024-08-27 20:14:14 +0300
commit38f287d7e495ae00d4481702f44ff7ca79f5c9bc (patch)
tree70f15159582cca5084d2111448c3523f2182514f /drivers/md/md-bitmap.h
parent2db4fa1b7e1897908d5cd11b1e22233ff0c6ba49 (diff)
downloadlinux-38f287d7e495ae00d4481702f44ff7ca79f5c9bc.tar.xz
md/md-bitmap: replace md_bitmap_status() with a new helper md_bitmap_get_stats()
There are no functional changes, and the new helper will be used in multiple places in following patches to avoid dereferencing bitmap directly. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240826074452.1490072-3-yukuai1@huaweicloud.com Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md-bitmap.h')
-rw-r--r--drivers/md/md-bitmap.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
index bb9eb418780a..b60418e3f573 100644
--- a/drivers/md/md-bitmap.h
+++ b/drivers/md/md-bitmap.h
@@ -234,6 +234,12 @@ struct bitmap {
int cluster_slot; /* Slot offset for clustered env */
};
+struct md_bitmap_stats {
+ unsigned long missing_pages;
+ unsigned long pages;
+ struct file *file;
+};
+
/* the bitmap API */
/* these are used only by md/bitmap */
@@ -244,7 +250,7 @@ void md_bitmap_destroy(struct mddev *mddev);
void md_bitmap_print_sb(struct bitmap *bitmap);
void md_bitmap_update_sb(struct bitmap *bitmap);
-void md_bitmap_status(struct seq_file *seq, struct bitmap *bitmap);
+int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats);
int md_bitmap_setallbits(struct bitmap *bitmap);
void md_bitmap_write_all(struct bitmap *bitmap);