diff options
author | 2023-05-12 09:56:09 +0800 | |
---|---|---|
committer | 2023-06-13 15:13:21 -0700 | |
commit | 3e00777d51572bdd75cef29c9c31106b52d7cc8f (patch) | |
tree | 24443a82e0f68ef994b8bea2532b4720c22a2fb9 /drivers/md/md.c | |
parent | md: export md_is_rdwr() and is_md_suspended() (diff) | |
download | linux-3e00777d51572bdd75cef29c9c31106b52d7cc8f.tar.gz linux-3e00777d51572bdd75cef29c9c31106b52d7cc8f.tar.bz2 linux-3e00777d51572bdd75cef29c9c31106b52d7cc8f.zip |
md: add a new api prepare_suspend() in md_personality
There are no functional changes, the new api will be used later to do
special handling for raid456 in md_suspend().
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230512015610.821290-5-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index fb060e381ae7..2f29d4e365c5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -448,6 +448,10 @@ void mddev_suspend(struct mddev *mddev) wake_up(&mddev->sb_wait); set_bit(MD_ALLOW_SB_UPDATE, &mddev->flags); percpu_ref_kill(&mddev->active_io); + + if (mddev->pers->prepare_suspend) + mddev->pers->prepare_suspend(mddev); + wait_event(mddev->sb_wait, percpu_ref_is_zero(&mddev->active_io)); mddev->pers->quiesce(mddev, 1); clear_bit_unlock(MD_ALLOW_SB_UPDATE, &mddev->flags); |