summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-03-05 10:23:00 +0300
committerSong Liu <song@kernel.org>2024-03-05 23:53:32 +0300
commit314e9af065513ff86ec9e32eaa96b9bd275cf51d (patch)
treec09c8f5c5ad861c1eb5f309fb661bcce7a0cda38 /drivers/md
parent7a2347e284d7ec2f0759be4db60fa7ca937284fc (diff)
downloadlinux-314e9af065513ff86ec9e32eaa96b9bd275cf51d.tar.xz
md: export helper md_is_rdwr()
There are no functional changes for now, prepare to fix a deadlock for dm-raid456. Cc: stable@vger.kernel.org # v6.7+ Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Xiao Ni <xni@redhat.com> Acked-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20240305072306.2562024-4-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c12
-rw-r--r--drivers/md/md.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0bf2f7a53ed8..55ecc05c17c6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -99,18 +99,6 @@ static void mddev_detach(struct mddev *mddev);
static void export_rdev(struct md_rdev *rdev, struct mddev *mddev);
static void md_wakeup_thread_directly(struct md_thread __rcu *thread);
-enum md_ro_state {
- MD_RDWR,
- MD_RDONLY,
- MD_AUTO_READ,
- MD_MAX_STATE
-};
-
-static bool md_is_rdwr(struct mddev *mddev)
-{
- return (mddev->ro == MD_RDWR);
-}
-
/*
* Default number of read corrections we'll attempt on an rdev
* before ejecting it from the array. We divide the read error
diff --git a/drivers/md/md.h b/drivers/md/md.h
index dff2e333756d..a40e898fe57e 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -569,6 +569,18 @@ enum recovery_flags {
MD_RESYNCING_REMOTE, /* remote node is running resync thread */
};
+enum md_ro_state {
+ MD_RDWR,
+ MD_RDONLY,
+ MD_AUTO_READ,
+ MD_MAX_STATE
+};
+
+static inline bool md_is_rdwr(struct mddev *mddev)
+{
+ return (mddev->ro == MD_RDWR);
+}
+
static inline int __must_check mddev_lock(struct mddev *mddev)
{
return mutex_lock_interruptible(&mddev->reconfig_mutex);