Commit 3cddf86a authored by Yu Kuai's avatar Yu Kuai Committed by Song Liu

md/md-bitmap: use new apis to suspend array for location_store()

Convert to use new apis, the old apis will be removed eventually.

This is not hot path, so performance is not concerned.
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231010151958.145896-8-yukuai1@huaweicloud.com
parent 4eb3327a
...@@ -2348,11 +2348,10 @@ location_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -2348,11 +2348,10 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
{ {
int rv; int rv;
rv = mddev_lock(mddev); rv = mddev_suspend_and_lock(mddev);
if (rv) if (rv)
return rv; return rv;
mddev_suspend(mddev);
if (mddev->pers) { if (mddev->pers) {
if (mddev->recovery || mddev->sync_thread) { if (mddev->recovery || mddev->sync_thread) {
rv = -EBUSY; rv = -EBUSY;
...@@ -2429,8 +2428,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len) ...@@ -2429,8 +2428,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
} }
rv = 0; rv = 0;
out: out:
mddev_resume(mddev); mddev_unlock_and_resume(mddev);
mddev_unlock(mddev);
if (rv) if (rv)
return rv; return rv;
return len; return len;
......
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