| Date | Tue, 14 Dec 2010 15:24:59 +0530 | From | "Suzuki K. Poulose" <> | Subject | [Patch 1/21] Reuse freezable() predicate |
| |
Export the freezable() predicate.
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> --- include/linux/freezer.h | 12 ++++++++++++ kernel/power/process.c | 9 --------- 2 files changed, 12 insertions(+), 9 deletions(-)
Index: linux-2.6.36-rc7/include/linux/freezer.h =================================================================== --- linux-2.6.36-rc7.orig/include/linux/freezer.h +++ linux-2.6.36-rc7/include/linux/freezer.h @@ -8,6 +8,18 @@ #ifdef CONFIG_FREEZER /* + * Check if the task is freezeable ? + */ +static inline int freezeable(struct task_struct * p) +{ + if ((p == current) || + (p->flags & PF_NOFREEZE) || + (p->exit_state != 0)) + return 0; + return 1; +} + +/* * Check if a process has been frozen */ static inline int frozen(struct task_struct *p) Index: linux-2.6.36-rc7/kernel/power/process.c =================================================================== --- linux-2.6.36-rc7.orig/kernel/power/process.c +++ linux-2.6.36-rc7/kernel/power/process.c @@ -22,15 +22,6 @@ */ #define TIMEOUT (20 * HZ) -static inline int freezeable(struct task_struct * p) -{ - if ((p == current) || - (p->flags & PF_NOFREEZE) || - (p->exit_state != 0)) - return 0; - return 1; -} - static int try_to_freeze_tasks(bool sig_only) { struct task_struct *g, *p;
|