summaryrefslogtreecommitdiffstats
path: root/kernel/power/main.c
diff options
context:
space:
mode:
authorHarry Pan <harry.pan@intel.com>2019-02-25 13:36:41 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-04-02 10:53:19 +0200
commitb5dee3130bb4014511f5d0dd46855ed843e3fdc8 (patch)
treed9abfcf2fc0743aa3283653c27655fee6b4f5487 /kernel/power/main.c
parentPM / wakeup: Use pm_pr_dbg() instead of pr_debug() (diff)
downloadlinux-b5dee3130bb4014511f5d0dd46855ed843e3fdc8.tar.xz
linux-b5dee3130bb4014511f5d0dd46855ed843e3fdc8.zip
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>
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 98e76cad128b..40472a7c5536 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -16,6 +16,7 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/suspend.h>
+#include <linux/syscalls.h>
#include "power.h"
@@ -51,6 +52,14 @@ void unlock_system_sleep(void)
}
EXPORT_SYMBOL_GPL(unlock_system_sleep);
+void ksys_sync_helper(void)
+{
+ pr_info("Syncing filesystems ... ");
+ ksys_sync();
+ pr_cont("done.\n");
+}
+EXPORT_SYMBOL_GPL(ksys_sync_helper);
+
/* Routines for PM-transition notifications */
static BLOCKING_NOTIFIER_HEAD(pm_chain_head);