All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: song@kernel.org, xni@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
	yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com,
	yangerkun@huawei.com
Subject: [PATCH -next v4 07/19] md/md-bitmap: use new apis to suspend array for location_store()
Date: Tue, 10 Oct 2023 23:19:46 +0800	[thread overview]
Message-ID: <20231010151958.145896-8-yukuai1@huaweicloud.com> (raw)
In-Reply-To: <20231010151958.145896-1-yukuai1@huaweicloud.com>

From: Yu Kuai <yukuai3@huawei.com>

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>
---
 drivers/md/md-bitmap.c | 6 ++----
 1 file 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;
-- 
2.39.2


  parent reply	other threads:[~2023-10-10  7:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 15:19 [PATCH -next v4 00/19] md: synchronize io with array reconfiguration Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 01/19] md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 02/19] md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 03/19] md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 04/19] md: add new helpers to suspend/resume array Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 05/19] md: add new helpers to suspend/resume and lock/unlock array Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 06/19] md/dm-raid: use new apis to suspend array Yu Kuai
2023-10-10 15:19 ` Yu Kuai [this message]
2023-10-10 15:19 ` [PATCH -next v4 08/19] md/raid5-cache: " Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 09/19] md/raid5: " Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 10/19] md: use new apis to suspend array for sysfs apis Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 11/19] md: use new apis to suspend array for adding/removing rdev from state_store() Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 12/19] md: use new apis to suspend array for ioctls involed array reconfiguration Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 13/19] md: use new apis to suspend array before mddev_create/destroy_serial_pool Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 14/19] md: cleanup mddev_create/destroy_serial_pool() Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 15/19] md/md-linear: cleanup linear_add() Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 16/19] md/raid5: replace suspend with quiesce() callback Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 17/19] md: suspend array in md_start_sync() if array need reconfiguration Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 18/19] md: remove old apis to suspend the array Yu Kuai
2023-10-10 15:19 ` [PATCH -next v4 19/19] md: rename __mddev_suspend/resume() back to mddev_suspend/resume() Yu Kuai
2023-10-11  2:47 ` [PATCH -next v4 00/19] md: synchronize io with array reconfiguration Song Liu
2023-10-11  3:25   ` Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231010151958.145896-8-yukuai1@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.