From 88f18ba028b5939bb6f77bd690e5ad8d01bb24cc Mon Sep 17 00:00:00 2001 From: Gautham R Shenoy Date: Wed, 23 May 2007 13:57:29 -0700 Subject: 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 Signed-off-by: Rafael J. Wysocki Cc: Oleg Nesterov Cc: Pavel Machek Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/power/process.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'kernel/power') 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) 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); -- cgit v1.2.3