[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111206160353.16729.91096.stgit@srivatsabhat.in.ibm.com>
Date: Tue, 06 Dec 2011 21:34:02 +0530
From: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To: rjw@...k.pl
Cc: pavel@....cz, len.brown@...el.com, tj@...nel.org, oleg@...hat.com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: [PATCH 2/2] PM: Use the freezer_count() functions in
[un]lock_system_sleep() APIs
Now that freezer_count() and freezer_do_not_count() don't have the restriction
that they are effective only when called by userspace processes, use
them in lock_system_sleep() and unlock_system_sleep() instead of open-coding
their parts.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---
include/linux/suspend.h | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 1f7fff4..906d62c 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -6,6 +6,7 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/mm.h>
+#include <linux/freezer.h>
#include <asm/errno.h>
#ifdef CONFIG_VT
@@ -380,16 +381,14 @@ static inline void unlock_system_sleep(void) {}
static inline void lock_system_sleep(void)
{
- /* simplified freezer_do_not_count() */
- current->flags |= PF_FREEZER_SKIP;
+ freezer_do_not_count();
mutex_lock(&pm_mutex);
}
static inline void unlock_system_sleep(void)
{
mutex_unlock(&pm_mutex);
- /* simplified freezer_count() */
- current->flags &= ~PF_FREEZER_SKIP;
+ freezer_count();
}
#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists