summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-10-10 23:19:46 +0800
committerSong Liu <song@kernel.org>2023-10-10 18:49:50 -0700
commit3cddf86a57a58441eb019d21acea147f043dc13c (patch)
tree63fc239b82a194fc7bdef8248cd75668d15d7553 /drivers/md
parent4eb3327aa28f3a737c2d3f7e35e83575f1d52283 (diff)
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: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20231010151958.145896-8-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md-bitmap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 0c661e5036bb..7d21e2a5b06e 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2348,11 +2348,10 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
{
int rv;
- rv = mddev_lock(mddev);
+ rv = mddev_suspend_and_lock(mddev);
if (rv)
return rv;
- mddev_suspend(mddev);
if (mddev->pers) {
if (mddev->recovery || mddev->sync_thread) {
rv = -EBUSY;
@@ -2429,8 +2428,7 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
}
rv = 0;
out:
- mddev_resume(mddev);
- mddev_unlock(mddev);
+ mddev_unlock_and_resume(mddev);
if (rv)
return rv;
return len;