diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/wait.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index c8e576022..569d33b6b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -959,5 +959,33 @@ static inline int wait_on_bit_lock(void *word, int bit, return 0; return out_of_line_wait_on_bit_lock(word, bit, action, mode); } - + +/* 3.18 backport */ +extern int bit_wait_io(void *); + +/** + * wait_on_bit_io - wait for a bit to be cleared + * @word: the word being waited on, a kernel virtual address + * @bit: the bit of the word being waited on + * @mode: the task state to sleep in + * + * Use the standard hashed waitqueue table to wait for a bit + * to be cleared. This is similar to wait_on_bit(), but calls + * io_schedule() instead of schedule() for the actual waiting. + * + * Returned value will be zero if the bit was cleared, or non-zero + * if the process received a signal and the mode permitted wakeup + * on that signal. + */ +static inline int +wait_on_bit_io(void *word, int bit, unsigned mode) +{ + might_sleep(); + if (!test_bit(bit, word)) + return 0; + return out_of_line_wait_on_bit(word, bit, + bit_wait_io, + mode); +} + #endif |
