PM / sleep: Refactor filesystems sync to reduce duplication

Create a common helper to sync filesystems for system suspend and
hibernation.

Signed-off-by: Harry Pan <harry.pan@intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Harry Pan 2019-02-25 20:36:41 +08:00 committed by Rafael J. Wysocki
parent 74a1dd86d1
commit b5dee3130b
5 changed files with 19 additions and 16 deletions

View file

@ -14,7 +14,6 @@
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/syscalls.h>
#include <linux/reboot.h>
#include <linux/string.h>
#include <linux/device.h>
@ -709,9 +708,7 @@ int hibernate(void)
goto Exit;
}
pr_info("Syncing filesystems ... \n");
ksys_sync();
pr_info("done.\n");
ksys_sync_helper();
error = freeze_processes();
if (error)