diff options
-rw-r--r-- | include/linux/freezer.h | 13 | ||||
-rw-r--r-- | kernel/power/process.c | 14 |
2 files changed, 13 insertions, 14 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 1045ee9c0bb4..4631086f5060 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -58,18 +58,6 @@ static inline int thaw_process(struct task_struct *p) | |||
58 | return 0; | 58 | return 0; |
59 | } | 59 | } |
60 | 60 | ||
61 | /* | ||
62 | * freezing is complete, mark process as frozen | ||
63 | */ | ||
64 | static inline void frozen_process(struct task_struct *p) | ||
65 | { | ||
66 | if (!unlikely(p->flags & PF_NOFREEZE)) { | ||
67 | p->flags |= PF_FROZEN; | ||
68 | wmb(); | ||
69 | } | ||
70 | clear_tsk_thread_flag(p, TIF_FREEZE); | ||
71 | } | ||
72 | |||
73 | extern void refrigerator(void); | 61 | extern void refrigerator(void); |
74 | extern int freeze_processes(void); | 62 | extern int freeze_processes(void); |
75 | extern void thaw_processes(void); | 63 | extern void thaw_processes(void); |
@@ -132,7 +120,6 @@ static inline int frozen(struct task_struct *p) { return 0; } | |||
132 | static inline int freezing(struct task_struct *p) { return 0; } | 120 | static inline int freezing(struct task_struct *p) { return 0; } |
133 | static inline void freeze(struct task_struct *p) { BUG(); } | 121 | static inline void freeze(struct task_struct *p) { BUG(); } |
134 | static inline int thaw_process(struct task_struct *p) { return 1; } | 122 | static inline int thaw_process(struct task_struct *p) { return 1; } |
135 | static inline void frozen_process(struct task_struct *p) { BUG(); } | ||
136 | 123 | ||
137 | static inline void refrigerator(void) {} | 124 | static inline void refrigerator(void) {} |
138 | static inline int freeze_processes(void) { BUG(); return 0; } | 125 | static inline int freeze_processes(void) { BUG(); return 0; } |
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 | */ | ||
37 | static 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 :-). */ |
35 | void refrigerator(void) | 47 | void 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); |