@@ -2037,8 +2037,8 @@ static struct bitmap *bitmap_get_from_slot(struct mddev *mddev, int slot)
/* Loads the bitmap associated with slot and copies the resync information
* to our bitmap
*/
-int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
- sector_t *low, sector_t *high, bool clear_bits)
+static int bitmap_copy_from_slot(struct mddev *mddev, int slot, sector_t *low,
+ sector_t *high, bool clear_bits)
{
int rv = 0, i, j;
sector_t block, lo = 0, hi = 0;
@@ -2080,8 +2080,6 @@ int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
return rv;
}
-EXPORT_SYMBOL_GPL(md_bitmap_copy_from_slot);
-
static void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
{
@@ -2716,6 +2714,7 @@ static struct bitmap_operations bitmap_ops = {
.resize = bitmap_resize,
.sync_with_cluster = bitmap_sync_with_cluster,
.get_from_slot = bitmap_get_from_slot,
+ .copy_from_slot = bitmap_copy_from_slot,
};
void mddev_set_bitmap_ops(struct mddev *mddev)
@@ -261,6 +261,8 @@ struct bitmap_operations {
sector_t old_lo, sector_t old_hi,
sector_t new_lo, sector_t new_hi);
struct bitmap* (*get_from_slot)(struct mddev *mddev, int slot);
+ int (*copy_from_slot)(struct mddev *mddev, int slot,
+ sector_t *lo, sector_t *hi, bool clear_bits);
};
/* the bitmap API */
@@ -421,12 +423,20 @@ static inline struct bitmap *md_bitmap_get_from_slot(struct mddev *mddev,
return mddev->bitmap_ops->get_from_slot(mddev, slot);
}
+static inline int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
+ sector_t *lo, sector_t *hi,
+ bool clear_bits)
+{
+ if (!mddev->bitmap_ops->copy_from_slot)
+ return -EOPNOTSUPP;
+
+ return mddev->bitmap_ops->copy_from_slot(mddev, slot, lo, hi, clear_bits);
+}
+
void md_bitmap_unplug(struct bitmap *bitmap);
void md_bitmap_unplug_async(struct bitmap *bitmap);
void md_bitmap_daemon_work(struct mddev *mddev);
-int md_bitmap_copy_from_slot(struct mddev *mddev, int slot,
- sector_t *lo, sector_t *hi, bool clear_bits);
void md_bitmap_free(struct bitmap *bitmap);
void md_bitmap_wait_behind_writes(struct mddev *mddev);