Commit 9e1cc0a5 authored by NeilBrown's avatar NeilBrown Committed by Shaohua Li

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

mddev_suspend() is a more general interface than
calling ->quiesce() and is so more extensible.  A
future patch will make use of this.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent b3143b9a
...@@ -4866,8 +4866,8 @@ suspend_lo_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -4866,8 +4866,8 @@ suspend_lo_store(struct mddev *mddev, const char *buf, size_t len)
mddev->pers->quiesce(mddev, 2); mddev->pers->quiesce(mddev, 2);
} else { } else {
/* Expanding suspended region - need to wait */ /* Expanding suspended region - need to wait */
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} }
err = 0; err = 0;
unlock: unlock:
...@@ -4910,8 +4910,8 @@ suspend_hi_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -4910,8 +4910,8 @@ suspend_hi_store(struct mddev *mddev, const char *buf, size_t len)
mddev->pers->quiesce(mddev, 2); mddev->pers->quiesce(mddev, 2);
} else { } else {
/* Expanding suspended region - need to wait */ /* Expanding suspended region - need to wait */
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} }
err = 0; err = 0;
unlock: unlock:
...@@ -6642,7 +6642,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd) ...@@ -6642,7 +6642,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
struct bitmap *bitmap; struct bitmap *bitmap;
bitmap = bitmap_create(mddev, -1); bitmap = bitmap_create(mddev, -1);
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
if (!IS_ERR(bitmap)) { if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap; mddev->bitmap = bitmap;
err = bitmap_load(mddev); err = bitmap_load(mddev);
...@@ -6652,11 +6652,11 @@ static int set_bitmap_file(struct mddev *mddev, int fd) ...@@ -6652,11 +6652,11 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
bitmap_destroy(mddev); bitmap_destroy(mddev);
fd = -1; fd = -1;
} }
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} else if (fd < 0) { } else if (fd < 0) {
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
bitmap_destroy(mddev); bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} }
} }
if (fd < 0) { if (fd < 0) {
...@@ -6942,7 +6942,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) ...@@ -6942,7 +6942,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
mddev->bitmap_info.space = mddev->bitmap_info.space =
mddev->bitmap_info.default_space; mddev->bitmap_info.default_space;
bitmap = bitmap_create(mddev, -1); bitmap = bitmap_create(mddev, -1);
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
if (!IS_ERR(bitmap)) { if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap; mddev->bitmap = bitmap;
rv = bitmap_load(mddev); rv = bitmap_load(mddev);
...@@ -6950,7 +6950,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) ...@@ -6950,7 +6950,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
rv = PTR_ERR(bitmap); rv = PTR_ERR(bitmap);
if (rv) if (rv)
bitmap_destroy(mddev); bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
} else { } else {
/* remove the bitmap */ /* remove the bitmap */
if (!mddev->bitmap) { if (!mddev->bitmap) {
...@@ -6973,9 +6973,9 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) ...@@ -6973,9 +6973,9 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
mddev->bitmap_info.nodes = 0; mddev->bitmap_info.nodes = 0;
md_cluster_ops->leave(mddev); md_cluster_ops->leave(mddev);
} }
mddev->pers->quiesce(mddev, 1); mddev_suspend(mddev);
bitmap_destroy(mddev); bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0); mddev_resume(mddev);
mddev->bitmap_info.offset = 0; mddev->bitmap_info.offset = 0;
} }
} }
......
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