diff options
Diffstat (limited to 'include/linux/wait_bit.h')
| -rw-r--r-- | include/linux/wait_bit.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index af0d495430d7..61b39eaf7cad 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h | |||
| @@ -26,6 +26,8 @@ struct wait_bit_queue_entry { | |||
| 26 | { .flags = p, .bit_nr = WAIT_ATOMIC_T_BIT_NR, } | 26 | { .flags = p, .bit_nr = WAIT_ATOMIC_T_BIT_NR, } |
| 27 | 27 | ||
| 28 | typedef int wait_bit_action_f(struct wait_bit_key *key, int mode); | 28 | typedef int wait_bit_action_f(struct wait_bit_key *key, int mode); |
| 29 | typedef int wait_atomic_t_action_f(atomic_t *counter, unsigned int mode); | ||
| 30 | |||
| 29 | void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit); | 31 | void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit); |
| 30 | int __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); | 32 | int __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue_entry *wbq_entry, wait_bit_action_f *action, unsigned int mode); |
| 31 | int __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); | 33 | int __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); |
| @@ -34,7 +36,7 @@ void wake_up_atomic_t(atomic_t *p); | |||
| 34 | int out_of_line_wait_on_bit(void *word, int, wait_bit_action_f *action, unsigned int mode); | 36 | int out_of_line_wait_on_bit(void *word, int, wait_bit_action_f *action, unsigned int mode); |
| 35 | int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout); | 37 | int out_of_line_wait_on_bit_timeout(void *word, int, wait_bit_action_f *action, unsigned int mode, unsigned long timeout); |
| 36 | int out_of_line_wait_on_bit_lock(void *word, int, wait_bit_action_f *action, unsigned int mode); | 38 | int out_of_line_wait_on_bit_lock(void *word, int, wait_bit_action_f *action, unsigned int mode); |
| 37 | int out_of_line_wait_on_atomic_t(atomic_t *p, int (*)(atomic_t *), unsigned int mode); | 39 | int out_of_line_wait_on_atomic_t(atomic_t *p, wait_atomic_t_action_f action, unsigned int mode); |
| 38 | struct wait_queue_head *bit_waitqueue(void *word, int bit); | 40 | struct wait_queue_head *bit_waitqueue(void *word, int bit); |
| 39 | extern void __init wait_bit_init(void); | 41 | extern void __init wait_bit_init(void); |
| 40 | 42 | ||
| @@ -51,10 +53,11 @@ int wake_bit_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync | |||
| 51 | }, \ | 53 | }, \ |
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | extern int bit_wait(struct wait_bit_key *key, int bit); | 56 | extern int bit_wait(struct wait_bit_key *key, int mode); |
| 55 | extern int bit_wait_io(struct wait_bit_key *key, int bit); | 57 | extern int bit_wait_io(struct wait_bit_key *key, int mode); |
| 56 | extern int bit_wait_timeout(struct wait_bit_key *key, int bit); | 58 | extern int bit_wait_timeout(struct wait_bit_key *key, int mode); |
| 57 | extern int bit_wait_io_timeout(struct wait_bit_key *key, int bit); | 59 | extern int bit_wait_io_timeout(struct wait_bit_key *key, int mode); |
| 60 | extern int atomic_t_wait(atomic_t *counter, unsigned int mode); | ||
| 58 | 61 | ||
| 59 | /** | 62 | /** |
| 60 | * wait_on_bit - wait for a bit to be cleared | 63 | * wait_on_bit - wait for a bit to be cleared |
| @@ -251,7 +254,7 @@ wait_on_bit_lock_action(unsigned long *word, int bit, wait_bit_action_f *action, | |||
| 251 | * outside of the target 'word'. | 254 | * outside of the target 'word'. |
| 252 | */ | 255 | */ |
| 253 | static inline | 256 | static inline |
| 254 | int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) | 257 | int wait_on_atomic_t(atomic_t *val, wait_atomic_t_action_f action, unsigned mode) |
| 255 | { | 258 | { |
| 256 | might_sleep(); | 259 | might_sleep(); |
| 257 | if (atomic_read(val) == 0) | 260 | if (atomic_read(val) == 0) |
