From 73de9cb6171d365baf1cd759e151799d96159924 Mon Sep 17 00:00:00 2001 From: Gautham R Shenoy Date: Wed, 23 May 2007 13:57:29 -0700 Subject: [PATCH] --- yaml --- r: 56867 b: refs/heads/master c: 88f18ba028b5939bb6f77bd690e5ad8d01bb24cc h: refs/heads/master i: 56865: 795018620257dbf3e1e02b1756fdcf831fcf36e5 56863: 7ac0d8fcfe08250601952839c385c3bb47fb1b09 v: v3 --- [refs] | 2 +- trunk/include/linux/freezer.h | 13 ------------- trunk/kernel/power/process.c | 14 +++++++++++++- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index bfe00be94e9d..c3aabf4e9b56 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5fcc57f2d5d558056668159f9153bf21d2c53d16 +refs/heads/master: 88f18ba028b5939bb6f77bd690e5ad8d01bb24cc diff --git a/trunk/include/linux/freezer.h b/trunk/include/linux/freezer.h index 1045ee9c0bb4..4631086f5060 100644 --- a/trunk/include/linux/freezer.h +++ b/trunk/include/linux/freezer.h @@ -58,18 +58,6 @@ static inline int thaw_process(struct task_struct *p) return 0; } -/* - * freezing is complete, mark process as frozen - */ -static inline void frozen_process(struct task_struct *p) -{ - if (!unlikely(p->flags & PF_NOFREEZE)) { - p->flags |= PF_FROZEN; - wmb(); - } - clear_tsk_thread_flag(p, TIF_FREEZE); -} - extern void refrigerator(void); extern int freeze_processes(void); extern void thaw_processes(void); @@ -132,7 +120,6 @@ static inline int frozen(struct task_struct *p) { return 0; } static inline int freezing(struct task_struct *p) { return 0; } static inline void freeze(struct task_struct *p) { BUG(); } static inline int thaw_process(struct task_struct *p) { return 1; } -static inline void frozen_process(struct task_struct *p) { BUG(); } static inline void refrigerator(void) {} static inline int freeze_processes(void) { BUG(); return 0; } diff --git a/trunk/kernel/power/process.c b/trunk/kernel/power/process.c index 2cea2658e985..d31d638ab4c0 100644 --- a/trunk/kernel/power/process.c +++ b/trunk/kernel/power/process.c @@ -31,6 +31,18 @@ static inline int freezeable(struct task_struct * p) return 1; } +/* + * freezing is complete, mark current process as frozen + */ +static inline void frozen_process(void) +{ + if (!unlikely(current->flags & PF_NOFREEZE)) { + current->flags |= PF_FROZEN; + wmb(); + } + clear_tsk_thread_flag(current, TIF_FREEZE); +} + /* Refrigerator is place where frozen processes are stored :-). */ void refrigerator(void) { @@ -40,7 +52,7 @@ void refrigerator(void) task_lock(current); if (freezing(current)) { - frozen_process(current); + frozen_process(); task_unlock(current); } else { task_unlock(current);