@@ -1755,7 +1755,8 @@ static void md_bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, in
}
/* dirty the memory and file bits for bitmap chunks "s" to "e" */
-void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e)
+static void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s,
+ unsigned long e)
{
unsigned long chunk;
@@ -2713,6 +2714,7 @@ static struct bitmap_operations bitmap_ops = {
.flush = bitmap_flush,
.status = bitmap_status,
.write_all = bitmap_write_all,
+ .dirty_bits = bitmap_dirty_bits,
.update_sb = bitmap_update_sb,
};
@@ -241,6 +241,7 @@ struct bitmap_operations {
void (*flush)(struct mddev *mddev);
void (*status)(struct seq_file *seq, struct bitmap *bitmap);
void (*write_all)(struct bitmap *bitmap);
+ void (*dirty_bits)(struct bitmap *bitmap, unsigned long s, unsigned long e);
void (*update_sb)(struct bitmap *bitmap);
};
@@ -305,7 +306,14 @@ static inline void md_bitmap_write_all(struct mddev *mddev)
mddev->bitmap_ops->write_all(mddev->bitmap);
}
-void md_bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e);
+static inline void md_bitmap_dirty_bits(struct mddev *mddev, unsigned long s,
+ unsigned long e)
+{
+ if (!mddev->bitmap || !mddev->bitmap_ops->dirty_bits)
+ return;
+
+ mddev->bitmap_ops->dirty_bits(mddev->bitmap, s, e);
+}
/* these are exported */
int md_bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
@@ -4688,7 +4688,7 @@ bitmap_store(struct mddev *mddev, const char *buf, size_t len)
if (buf == end) break;
}
if (*end && !isspace(*end)) break;
- md_bitmap_dirty_bits(mddev->bitmap, chunk, end_chunk);
+ md_bitmap_dirty_bits(mddev, chunk, end_chunk);
buf = skip_spaces(end);
}
md_bitmap_unplug(mddev->bitmap); /* flush the bits to disk */