aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGautham R Shenoy <ego@in.ibm.com>2007-05-23 16:57:29 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 23:14:11 -0400
commit88f18ba028b5939bb6f77bd690e5ad8d01bb24cc (patch)
treeeea3f79f5098f7b45723f842208b44f860f0fb71 /kernel
parent5fcc57f2d5d558056668159f9153bf21d2c53d16 (diff)
freezer: move frozen_process() to kernel/power/process.c
Other than refrigerator, no one else calls frozen_process(). So move it from include/linux/freezer.h to kernel/power/process.c. Also, since a task can be marked as frozen by itself, we don't need to pass the (struct task_struct *p) parameter to frozen_process(). Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Pavel Machek <pavel@ucw.cz> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/process.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 2cea2658e985..d31d638ab4c0 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -31,6 +31,18 @@ static inline int freezeable(struct task_struct * p)
31 return 1; 31 return 1;
32} 32}
33 33
34/*
35 * freezing is complete, mark current process as frozen
36 */
37static inline void frozen_process(void)
38{
39 if (!unlikely(current->flags & PF_NOFREEZE)) {
40 current->flags |= PF_FROZEN;
41 wmb();
42 }
43 clear_tsk_thread_flag(current, TIF_FREEZE);
44}
45
34/* Refrigerator is place where frozen processes are stored :-). */ 46/* Refrigerator is place where frozen processes are stored :-). */
35void refrigerator(void) 47void refrigerator(void)
36{ 48{
@@ -40,7 +52,7 @@ void refrigerator(void)
40 52
41 task_lock(current); 53 task_lock(current);
42 if (freezing(current)) { 54 if (freezing(current)) {
43 frozen_process(current); 55 frozen_process();
44 task_unlock(current); 56 task_unlock(current);
45 } else { 57 } else {
46 task_unlock(current); 58 task_unlock(current);