mirror of
https://github.com/torvalds/linux.git
synced 2025-11-06 19:50:24 +02:00
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
This commit is contained in:
parent
431e61257d
commit
3e00777d51
2 changed files with 5 additions and 0 deletions
|
|
@ -448,6 +448,10 @@ void mddev_suspend(struct mddev *mddev)
|
||||||
wake_up(&mddev->sb_wait);
|
wake_up(&mddev->sb_wait);
|
||||||
set_bit(MD_ALLOW_SB_UPDATE, &mddev->flags);
|
set_bit(MD_ALLOW_SB_UPDATE, &mddev->flags);
|
||||||
percpu_ref_kill(&mddev->active_io);
|
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));
|
wait_event(mddev->sb_wait, percpu_ref_is_zero(&mddev->active_io));
|
||||||
mddev->pers->quiesce(mddev, 1);
|
mddev->pers->quiesce(mddev, 1);
|
||||||
clear_bit_unlock(MD_ALLOW_SB_UPDATE, &mddev->flags);
|
clear_bit_unlock(MD_ALLOW_SB_UPDATE, &mddev->flags);
|
||||||
|
|
|
||||||
|
|
@ -631,6 +631,7 @@ struct md_personality
|
||||||
int (*start_reshape) (struct mddev *mddev);
|
int (*start_reshape) (struct mddev *mddev);
|
||||||
void (*finish_reshape) (struct mddev *mddev);
|
void (*finish_reshape) (struct mddev *mddev);
|
||||||
void (*update_reshape_pos) (struct mddev *mddev);
|
void (*update_reshape_pos) (struct mddev *mddev);
|
||||||
|
void (*prepare_suspend) (struct mddev *mddev);
|
||||||
/* quiesce suspends or resumes internal processing.
|
/* quiesce suspends or resumes internal processing.
|
||||||
* 1 - stop new actions and wait for action io to complete
|
* 1 - stop new actions and wait for action io to complete
|
||||||
* 0 - return to normal behaviour
|
* 0 - return to normal behaviour
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue