Skip to content

Commit 314e9af

Browse files
YuKuai-huaweiliu-song-6
authored andcommitted
md: export helper md_is_rdwr()
There are no functional changes for now, prepare to fix a deadlock for dm-raid456. Cc: [email protected] # v6.7+ Signed-off-by: Yu Kuai <[email protected]> Signed-off-by: Xiao Ni <[email protected]> Acked-by: Mike Snitzer <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7a2347e commit 314e9af

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/md/md.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,6 @@ static void mddev_detach(struct mddev *mddev);
9999
static void export_rdev(struct md_rdev *rdev, struct mddev *mddev);
100100
static void md_wakeup_thread_directly(struct md_thread __rcu *thread);
101101

102-
enum md_ro_state {
103-
MD_RDWR,
104-
MD_RDONLY,
105-
MD_AUTO_READ,
106-
MD_MAX_STATE
107-
};
108-
109-
static bool md_is_rdwr(struct mddev *mddev)
110-
{
111-
return (mddev->ro == MD_RDWR);
112-
}
113-
114102
/*
115103
* Default number of read corrections we'll attempt on an rdev
116104
* before ejecting it from the array. We divide the read error

drivers/md/md.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,18 @@ enum recovery_flags {
569569
MD_RESYNCING_REMOTE, /* remote node is running resync thread */
570570
};
571571

572+
enum md_ro_state {
573+
MD_RDWR,
574+
MD_RDONLY,
575+
MD_AUTO_READ,
576+
MD_MAX_STATE
577+
};
578+
579+
static inline bool md_is_rdwr(struct mddev *mddev)
580+
{
581+
return (mddev->ro == MD_RDWR);
582+
}
583+
572584
static inline int __must_check mddev_lock(struct mddev *mddev)
573585
{
574586
return mutex_lock_interruptible(&mddev->reconfig_mutex);

0 commit comments

Comments
 (0)