summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md-bitmap.c7
-rw-r--r--drivers/md/md-bitmap.h2
-rw-r--r--drivers/md/md.c15
3 files changed, 13 insertions, 11 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index c236754df66e..dc898db266d0 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -1853,7 +1853,7 @@ void md_bitmap_wait_behind_writes(struct mddev *mddev)
}
EXPORT_SYMBOL_GPL(md_bitmap_wait_behind_writes);
-void md_bitmap_destroy(struct mddev *mddev)
+static void bitmap_destroy(struct mddev *mddev)
{
struct bitmap *bitmap = mddev->bitmap;
@@ -2384,7 +2384,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
goto out;
}
- md_bitmap_destroy(mddev);
+ bitmap_destroy(mddev);
mddev->bitmap_info.offset = 0;
if (mddev->bitmap_info.file) {
struct file *f = mddev->bitmap_info.file;
@@ -2427,7 +2427,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
rv = bitmap_load(mddev);
if (rv) {
mddev->bitmap_info.offset = 0;
- md_bitmap_destroy(mddev);
+ bitmap_destroy(mddev);
goto out;
}
}
@@ -2724,6 +2724,7 @@ const struct attribute_group md_bitmap_group = {
static struct bitmap_operations bitmap_ops = {
.create = bitmap_create,
.load = bitmap_load,
+ .destroy = bitmap_destroy,
};
void mddev_set_bitmap_ops(struct mddev *mddev)
diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
index f5b04b61d9e9..c8d27b91241b 100644
--- a/drivers/md/md-bitmap.h
+++ b/drivers/md/md-bitmap.h
@@ -249,6 +249,7 @@ struct md_bitmap_stats {
struct bitmap_operations {
int (*create)(struct mddev *mddev, int slot);
int (*load)(struct mddev *mddev);
+ void (*destroy)(struct mddev *mddev);
};
/* the bitmap API */
@@ -256,7 +257,6 @@ void mddev_set_bitmap_ops(struct mddev *mddev);
/* these are used only by md/bitmap */
void md_bitmap_flush(struct mddev *mddev);
-void md_bitmap_destroy(struct mddev *mddev);
void md_bitmap_print_sb(struct bitmap *bitmap);
void md_bitmap_update_sb(struct bitmap *bitmap);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9c63be7aa6a5..eeb17eb1fc02 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6297,7 +6297,7 @@ bitmap_abort:
pers->free(mddev, mddev->private);
mddev->private = NULL;
module_put(pers->owner);
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
abort:
bioset_exit(&mddev->io_clone_set);
exit_sync_set:
@@ -6319,7 +6319,7 @@ int do_md_run(struct mddev *mddev)
err = mddev->bitmap_ops->load(mddev);
if (err) {
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
goto out;
}
@@ -6505,7 +6505,8 @@ static void mddev_detach(struct mddev *mddev)
static void __md_stop(struct mddev *mddev)
{
struct md_personality *pers = mddev->pers;
- md_bitmap_destroy(mddev);
+
+ mddev->bitmap_ops->destroy(mddev);
mddev_detach(mddev);
spin_lock(&mddev->lock);
mddev->pers = NULL;
@@ -7288,11 +7289,11 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
err = mddev->bitmap_ops->load(mddev);
if (err) {
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
fd = -1;
}
} else if (fd < 0) {
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
}
}
@@ -7582,7 +7583,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
rv = mddev->bitmap_ops->load(mddev);
if (rv)
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
} else {
struct md_bitmap_stats stats;
@@ -7609,7 +7610,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
module_put(md_cluster_mod);
mddev->safemode_delay = DEFAULT_SAFEMODE_DELAY;
}
- md_bitmap_destroy(mddev);
+ mddev->bitmap_ops->destroy(mddev);
mddev->bitmap_info.offset = 0;
}
}