aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/wait_bit.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2018-03-15 06:46:30 -0400
committerIngo Molnar <mingo@kernel.org>2018-03-20 03:23:24 -0400
commit9b8cce52c4b5c08297900bfdcafc6b08d9bc4a27 (patch)
treed6ab6abb1f72998fd12620d54ad8431b83450d42 /include/linux/wait_bit.h
parent6887a56b6e8ef5daf1160f2ebe5cbe38fd8819a2 (diff)
sched/wait: Remove the wait_on_atomic_t() API
There are no users left (everyone got converted to wait_var_event()), remove it. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/wait_bit.h')
-rw-r--r--include/linux/wait_bit.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h
index 3fcdb75d69cf..9318b2166439 100644
--- a/include/linux/wait_bit.h
+++ b/include/linux/wait_bit.h
@@ -10,7 +10,6 @@
10struct wait_bit_key { 10struct wait_bit_key {
11 void *flags; 11 void *flags;
12 int bit_nr; 12 int bit_nr;
13#define WAIT_ATOMIC_T_BIT_NR -1
14 unsigned long timeout; 13 unsigned long timeout;
15}; 14};
16 15
@@ -22,21 +21,15 @@ struct wait_bit_queue_entry {
22#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ 21#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \
23 { .flags = word, .bit_nr = bit, } 22 { .flags = word, .bit_nr = bit, }
24 23
25#define __WAIT_ATOMIC_T_KEY_INITIALIZER(p) \
26 { .flags = p, .bit_nr = WAIT_ATOMIC_T_BIT_NR, }
27
28typedef int wait_bit_action_f(struct wait_bit_key *key, int mode); 24typedef int wait_bit_action_f(struct wait_bit_key *key, int mode);
29typedef int wait_atomic_t_action_f(atomic_t *counter, unsigned int mode);
30 25
31void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit); 26void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit);
32int __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); 27int __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode);
33int __wait_on_bit_lock(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); 28int __wait_on_bit_lock(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode);
34void wake_up_bit(void *word, int bit); 29void wake_up_bit(void *word, int bit);
35void wake_up_atomic_t(atomic_t *p);
36int out_of_line_wait_on_bit(void *word, int, wait_bit_action_f *action, unsigned int mode); 30int out_of_line_wait_on_bit(void *word, int, wait_bit_action_f *action, unsigned int mode);
37int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout); 31int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout);
38int out_of_line_wait_on_bit_lock(void *word, int, wait_bit_action_f *action, unsigned int mode); 32int out_of_line_wait_on_bit_lock(void *word, int, wait_bit_action_f *action, unsigned int mode);
39int out_of_line_wait_on_atomic_t(atomic_t *p, wait_atomic_t_action_f action, unsigned int mode);
40struct wait_queue_head *bit_waitqueue(void *word, int bit); 33struct wait_queue_head *bit_waitqueue(void *word, int bit);
41extern void __init wait_bit_init(void); 34extern void __init wait_bit_init(void);
42 35
@@ -57,7 +50,6 @@ extern int bit_wait(struct wait_bit_key *key, int mode);
57extern int bit_wait_io(struct wait_bit_key *key, int mode); 50extern int bit_wait_io(struct wait_bit_key *key, int mode);
58extern int bit_wait_timeout(struct wait_bit_key *key, int mode); 51extern int bit_wait_timeout(struct wait_bit_key *key, int mode);
59extern int bit_wait_io_timeout(struct wait_bit_key *key, int mode); 52extern int bit_wait_io_timeout(struct wait_bit_key *key, int mode);
60extern int atomic_t_wait(atomic_t *counter, unsigned int mode);
61 53
62/** 54/**
63 * wait_on_bit - wait for a bit to be cleared 55 * wait_on_bit - wait for a bit to be cleared
@@ -243,25 +235,6 @@ wait_on_bit_lock_action(unsigned long *word, int bit, wait_bit_action_f *action,
243 return out_of_line_wait_on_bit_lock(word, bit, action, mode); 235 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
244} 236}
245 237
246/**
247 * wait_on_atomic_t - Wait for an atomic_t to become 0
248 * @val: The atomic value being waited on, a kernel virtual address
249 * @action: the function used to sleep, which may take special actions
250 * @mode: the task state to sleep in
251 *
252 * Wait for an atomic_t to become 0. We abuse the bit-wait waitqueue table for
253 * the purpose of getting a waitqueue, but we set the key to a bit number
254 * outside of the target 'word'.
255 */
256static inline
257int wait_on_atomic_t(atomic_t *val, wait_atomic_t_action_f action, unsigned mode)
258{
259 might_sleep();
260 if (atomic_read(val) == 0)
261 return 0;
262 return out_of_line_wait_on_atomic_t(val, action, mode);
263}
264
265extern void init_wait_var_entry(struct wait_bit_queue_entry *wbq_entry, void *var, int flags); 238extern void init_wait_var_entry(struct wait_bit_queue_entry *wbq_entry, void *var, int flags);
266extern void wake_up_var(void *var); 239extern void wake_up_var(void *var);
267extern wait_queue_head_t *__var_waitqueue(void *p); 240extern wait_queue_head_t *__var_waitqueue(void *p);