@@ -2092,7 +2092,7 @@ int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
EXPORT_SYMBOL_GPL(md_bitmap_copy_from_slot);
-void md_bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
+static void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
{
unsigned long chunk_kb;
struct bitmap_counts *counts;
@@ -2711,6 +2711,7 @@ static struct bitmap_operations bitmap_ops = {
.load = bitmap_load,
.destroy = bitmap_destroy,
.flush = bitmap_flush,
+ .status = bitmap_status,
.update_sb = bitmap_update_sb,
};
@@ -239,6 +239,7 @@ struct bitmap_operations {
int (*load)(struct mddev *mddev);
void (*destroy)(struct mddev *mddev);
void (*flush)(struct mddev *mddev);
+ void (*status)(struct seq_file *seq, struct bitmap *bitmap);
void (*update_sb)(struct bitmap *bitmap);
};
@@ -279,6 +280,14 @@ static inline void md_bitmap_flush(struct mddev *mddev)
mddev->bitmap_ops->flush(mddev);
}
+static inline void md_bitmap_status(struct seq_file *seq, struct mddev *mddev)
+{
+ if (!mddev->bitmap || !mddev->bitmap_ops->status)
+ return;
+
+ mddev->bitmap_ops->status(seq, mddev->bitmap);
+}
+
static inline void md_bitmap_update_sb(struct mddev *mddev)
{
if (!mddev->bitmap || !mddev->bitmap_ops->update_sb)
@@ -287,8 +296,6 @@ static inline void md_bitmap_update_sb(struct mddev *mddev)
mddev->bitmap_ops->update_sb(mddev->bitmap);
}
-void md_bitmap_status(struct seq_file *seq, struct bitmap *bitmap);
-
int md_bitmap_setallbits(struct bitmap *bitmap);
void md_bitmap_write_all(struct bitmap *bitmap);
@@ -8454,7 +8454,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
} else
seq_printf(seq, "\n ");
- md_bitmap_status(seq, mddev->bitmap);
+ md_bitmap_status(seq, mddev);
seq_printf(seq, "\n");
}