@@ -3949,7 +3949,9 @@ static int __load_dirty_region_bitmap(struct raid_set *rs)
/* Try loading the bitmap unless "raid0", which does not have one */
if (!rs_is_raid0(rs) &&
!test_and_set_bit(RT_FLAG_RS_BITMAP_LOADED, &rs->runtime_flags)) {
- r = md_bitmap_load(&rs->md);
+ struct mddev *mddev = &rs->md;
+
+ r = mddev->bitmap_ops->load(mddev);
if (r)
DMERR("Failed to load bitmap");
}
@@ -1977,7 +1977,7 @@ static int bitmap_create(struct mddev *mddev, int slot)
return 0;
}
-int md_bitmap_load(struct mddev *mddev)
+static int bitmap_load(struct mddev *mddev)
{
int err = 0;
sector_t start = 0;
@@ -2033,7 +2033,6 @@ int md_bitmap_load(struct mddev *mddev)
out:
return err;
}
-EXPORT_SYMBOL_GPL(md_bitmap_load);
/* caller need to free returned bitmap with md_bitmap_free() */
struct bitmap *get_bitmap_from_slot(struct mddev *mddev, int slot)
@@ -2422,7 +2421,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
if (rv)
goto out;
- rv = md_bitmap_load(mddev);
+ rv = bitmap_load(mddev);
if (rv) {
mddev->bitmap_info.offset = 0;
md_bitmap_destroy(mddev);
@@ -2721,6 +2720,7 @@ const struct attribute_group md_bitmap_group = {
static struct bitmap_operations bitmap_ops = {
.create = bitmap_create,
+ .load = bitmap_load,
};
void mddev_set_bitmap_ops(struct mddev *mddev)
@@ -247,13 +247,13 @@ struct md_bitmap_stats {
struct bitmap_operations {
int (*create)(struct mddev *mddev, int slot);
+ int (*load)(struct mddev *mddev);
};
/* the bitmap API */
void mddev_set_bitmap_ops(struct mddev *mddev);
/* these are used only by md/bitmap */
-int md_bitmap_load(struct mddev *mddev);
void md_bitmap_flush(struct mddev *mddev);
void md_bitmap_destroy(struct mddev *mddev);
@@ -6303,7 +6303,8 @@ int do_md_run(struct mddev *mddev)
err = md_run(mddev);
if (err)
goto out;
- err = md_bitmap_load(mddev);
+
+ err = mddev->bitmap_ops->load(mddev);
if (err) {
md_bitmap_destroy(mddev);
goto out;
@@ -7271,7 +7272,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
if (fd >= 0) {
err = mddev->bitmap_ops->create(mddev, -1);
if (!err)
- err = md_bitmap_load(mddev);
+ err = mddev->bitmap_ops->load(mddev);
if (err) {
md_bitmap_destroy(mddev);
@@ -7565,7 +7566,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
mddev->bitmap_info.default_space;
rv = mddev->bitmap_ops->create(mddev, -1);
if (!rv)
- rv = md_bitmap_load(mddev);
+ rv = mddev->bitmap_ops->load(mddev);
if (rv)
md_bitmap_destroy(mddev);