aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/freezer.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index a5386e3ee756..7a9427e9fe47 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -47,18 +47,17 @@ static inline bool should_send_signal(struct task_struct *p)
47/* Takes and releases task alloc lock using task_lock() */ 47/* Takes and releases task alloc lock using task_lock() */
48extern int thaw_process(struct task_struct *p); 48extern int thaw_process(struct task_struct *p);
49 49
50extern void refrigerator(void); 50extern bool __refrigerator(void);
51extern int freeze_processes(void); 51extern int freeze_processes(void);
52extern int freeze_kernel_threads(void); 52extern int freeze_kernel_threads(void);
53extern void thaw_processes(void); 53extern void thaw_processes(void);
54 54
55static inline int try_to_freeze(void) 55static inline bool try_to_freeze(void)
56{ 56{
57 if (freezing(current)) { 57 might_sleep();
58 refrigerator(); 58 if (likely(!freezing(current)))
59 return 1; 59 return false;
60 } else 60 return __refrigerator();
61 return 0;
62} 61}
63 62
64extern bool freeze_task(struct task_struct *p, bool sig_only); 63extern bool freeze_task(struct task_struct *p, bool sig_only);
@@ -181,12 +180,12 @@ static inline void set_freeze_flag(struct task_struct *p) {}
181static inline void clear_freeze_flag(struct task_struct *p) {} 180static inline void clear_freeze_flag(struct task_struct *p) {}
182static inline int thaw_process(struct task_struct *p) { return 1; } 181static inline int thaw_process(struct task_struct *p) { return 1; }
183 182
184static inline void refrigerator(void) {} 183static inline bool __refrigerator(void) { return false; }
185static inline int freeze_processes(void) { return -ENOSYS; } 184static inline int freeze_processes(void) { return -ENOSYS; }
186static inline int freeze_kernel_threads(void) { return -ENOSYS; } 185static inline int freeze_kernel_threads(void) { return -ENOSYS; }
187static inline void thaw_processes(void) {} 186static inline void thaw_processes(void) {}
188 187
189static inline int try_to_freeze(void) { return 0; } 188static inline bool try_to_freeze(void) { return false; }
190 189
191static inline void freezer_do_not_count(void) {} 190static inline void freezer_do_not_count(void) {}
192static inline void freezer_count(void) {} 191static inline void freezer_count(void) {}