Commit 88f18ba0 authored by Gautham R Shenoy's avatar Gautham R Shenoy Committed by Linus Torvalds

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: default avatarGautham R Shenoy <ego@in.ibm.com>
Signed-off-by: default avatarRafael 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5fcc57f2
...@@ -58,18 +58,6 @@ static inline int thaw_process(struct task_struct *p) ...@@ -58,18 +58,6 @@ static inline int thaw_process(struct task_struct *p)
return 0; 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 void refrigerator(void);
extern int freeze_processes(void); extern int freeze_processes(void);
extern void thaw_processes(void); extern void thaw_processes(void);
...@@ -132,7 +120,6 @@ static inline int frozen(struct task_struct *p) { return 0; } ...@@ -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 int freezing(struct task_struct *p) { return 0; }
static inline void freeze(struct task_struct *p) { BUG(); } static inline void freeze(struct task_struct *p) { BUG(); }
static inline int thaw_process(struct task_struct *p) { return 1; } 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 void refrigerator(void) {}
static inline int freeze_processes(void) { BUG(); return 0; } static inline int freeze_processes(void) { BUG(); return 0; }
......
...@@ -31,6 +31,18 @@ static inline int freezeable(struct task_struct * p) ...@@ -31,6 +31,18 @@ static inline int freezeable(struct task_struct * p)
return 1; 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 :-). */ /* Refrigerator is place where frozen processes are stored :-). */
void refrigerator(void) void refrigerator(void)
{ {
...@@ -40,7 +52,7 @@ void refrigerator(void) ...@@ -40,7 +52,7 @@ void refrigerator(void)
task_lock(current); task_lock(current);
if (freezing(current)) { if (freezing(current)) {
frozen_process(current); frozen_process();
task_unlock(current); task_unlock(current);
} else { } else {
task_unlock(current); task_unlock(current);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment