@@ -1776,7 +1776,7 @@ void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long
/*
* flush out any pending updates
*/
-void md_bitmap_flush(struct mddev *mddev)
+static void bitmap_flush(struct mddev *mddev)
{
struct bitmap *bitmap = mddev->bitmap;
long sleep;
@@ -2711,6 +2711,7 @@ static struct bitmap_operations bitmap_ops = {
.create = bitmap_create,
.load = bitmap_load,
.destroy = bitmap_destroy,
+ .flush = bitmap_flush,
};
void mddev_set_bitmap_ops(struct mddev *mddev)
@@ -238,6 +238,7 @@ struct bitmap_operations {
struct bitmap* (*create)(struct mddev *mddev, int slot);
int (*load)(struct mddev *mddev);
void (*destroy)(struct mddev *mddev);
+ void (*flush)(struct mddev *mddev);
};
/* the bitmap API */
@@ -268,7 +269,13 @@ static inline void md_bitmap_destroy(struct mddev *mddev)
mddev->bitmap_ops->destroy(mddev);
}
-void md_bitmap_flush(struct mddev *mddev);
+static inline void md_bitmap_flush(struct mddev *mddev)
+{
+ if (!mddev->bitmap_ops->flush)
+ return;
+
+ mddev->bitmap_ops->flush(mddev);
+}
void md_bitmap_print_sb(struct bitmap *bitmap);
void md_bitmap_update_sb(struct bitmap *bitmap);