]> err.no Git - linux-2.6/blobdiff - kernel/power/main.c
Merge branch 'master' into upstream-fixes
[linux-2.6] / kernel / power / main.c
index 7d09a9894947c6b914cd04c04b5690093e265300..3cdf95b1dc92af97e13e8a6c68c4e0a6f8d42153 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/resume-trace.h>
 #include <linux/freezer.h>
 #include <linux/vmstat.h>
+#include <linux/syscalls.h>
 
 #include "power.h"
 
@@ -32,7 +33,7 @@ DEFINE_MUTEX(pm_mutex);
 /* This is just an arbitrary number */
 #define FREE_PAGE_NUMBER (100)
 
-struct platform_suspend_ops *suspend_ops;
+static struct platform_suspend_ops *suspend_ops;
 
 /**
  *     suspend_set_ops - Set the global suspend method table.
@@ -230,9 +231,14 @@ static int enter_state(suspend_state_t state)
 
        if (!valid_state(state))
                return -ENODEV;
+
        if (!mutex_trylock(&pm_mutex))
                return -EBUSY;
 
+       printk("Syncing filesystems ... ");
+       sys_sync();
+       printk("done.\n");
+
        pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
        if ((error = suspend_prepare()))
                goto Unlock;