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>
This commit is contained in:
Gautham R Shenoy 2007-05-23 13:57:29 -07:00 committed by Linus Torvalds
parent 5fcc57f2d5
commit 88f18ba028
2 changed files with 13 additions and 14 deletions

View file

@ -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);