Commit f8f83d8f authored by Jack Wang's avatar Jack Wang Committed by Shaohua Li

md/bitmap: use mddev_suspend/resume instead of ->quiesce()

After 9e1cc0a5 ("md: use mddev_suspend/resume instead of ->quiesce()")
We still have similar left in bitmap functions.

Replace quiesce() with mddev_suspend/resume.

Also move md_bitmap_create out of mddev_suspend. and move mddev_resume
after md_bitmap_destroy. as we did in set_bitmap_file.
Signed-off-by: default avatarJack Wang <jinpu.wang@profitbricks.com>
Reviewed-by: default avatarGioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 116d99ad
...@@ -2288,9 +2288,9 @@ location_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -2288,9 +2288,9 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
goto out; goto out;
} }
if (mddev->pers) { if (mddev->pers) {
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
md_bitmap_destroy(mddev); md_bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} }
mddev->bitmap_info.offset = 0; mddev->bitmap_info.offset = 0;
if (mddev->bitmap_info.file) { if (mddev->bitmap_info.file) {
...@@ -2327,8 +2327,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -2327,8 +2327,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
mddev->bitmap_info.offset = offset; mddev->bitmap_info.offset = offset;
if (mddev->pers) { if (mddev->pers) {
struct bitmap *bitmap; struct bitmap *bitmap;
mddev->pers->quiesce(mddev, 1);
bitmap = md_bitmap_create(mddev, -1); bitmap = md_bitmap_create(mddev, -1);
mddev_suspend(mddev);
if (IS_ERR(bitmap)) if (IS_ERR(bitmap))
rv = PTR_ERR(bitmap); rv = PTR_ERR(bitmap);
else { else {
...@@ -2337,11 +2337,12 @@ location_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -2337,11 +2337,12 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
if (rv) if (rv)
mddev->bitmap_info.offset = 0; mddev->bitmap_info.offset = 0;
} }
mddev->pers->quiesce(mddev, 0);
if (rv) { if (rv) {
md_bitmap_destroy(mddev); md_bitmap_destroy(mddev);
mddev_resume(mddev);
goto out; goto out;
} }
mddev_resume(mddev);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment