mirror of https://github.com/torvalds/linux.git
PM: sleep: Call pm_sleep_fs_sync() instead of ksys_sync_helper()
Replace the direct calls to ksys_sync_helper() with the new pm_sleep_fs_sync() in suspend and hibernation code paths. This enables the new mechanism allowing the filesystem sync phase to be interrupted. Suggested-by: Saravana Kannan <saravanak@google.com> Signed-off-by: Samuel Wu <wusamuel@google.com> Co-developed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ rjw: Subject and changelog edits, tags adjustment ] Link: https://patch.msgid.link/20251119171426.4086783-3-wusamuel@google.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
bf8867eae1
commit
8e2d57e653
|
|
@ -820,7 +820,10 @@ int hibernate(void)
|
|||
if (error)
|
||||
goto Restore;
|
||||
|
||||
ksys_sync_helper();
|
||||
error = pm_sleep_fs_sync();
|
||||
if (error)
|
||||
goto Notify;
|
||||
|
||||
if (filesystem_freeze_enabled)
|
||||
filesystems_freeze();
|
||||
|
||||
|
|
@ -892,6 +895,7 @@ int hibernate(void)
|
|||
freezer_test_done = false;
|
||||
Exit:
|
||||
filesystems_thaw();
|
||||
Notify:
|
||||
pm_notifier_call_chain(PM_POST_HIBERNATION);
|
||||
Restore:
|
||||
pm_restore_console();
|
||||
|
|
|
|||
|
|
@ -594,7 +594,11 @@ static int enter_state(suspend_state_t state)
|
|||
|
||||
if (sync_on_suspend_enabled) {
|
||||
trace_suspend_resume(TPS("sync_filesystems"), 0, true);
|
||||
ksys_sync_helper();
|
||||
|
||||
error = pm_sleep_fs_sync();
|
||||
if (error)
|
||||
goto Unlock;
|
||||
|
||||
trace_suspend_resume(TPS("sync_filesystems"), 0, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
|
|||
if (data->frozen)
|
||||
break;
|
||||
|
||||
ksys_sync_helper();
|
||||
error = pm_sleep_fs_sync();
|
||||
if (error)
|
||||
break;
|
||||
|
||||
error = freeze_processes();
|
||||
if (error)
|
||||
|
|
|
|||
Loading…
Reference in New Issue