diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2018-05-23 11:05:26 +0200 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2018-05-23 11:05:59 +0200 |
| commit | dd8070bff204a67fcb6585f18047841a895b68d7 (patch) | |
| tree | cce17d4b8eb8987194beb40498c8f83e74d6799f /include/linux/wait_bit.h | |
| parent | f3a7ca64587f58686d4e2e894e9abbfbc9dffb25 (diff) | |
| parent | 1fe8c06c4a0d3b589f076cd00c25082840f10423 (diff) | |
Merge remote-tracking branch 'net-next/master' into mac80211-next
Bring in net-next which had pulled in net, so I have the changes
from mac80211 and can apply a patch that would otherwise conflict.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux/wait_bit.h')
| -rw-r--r-- | include/linux/wait_bit.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 9318b2166439..2b0072fa5e92 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h @@ -305,4 +305,21 @@ do { \ __ret; \ }) +/** + * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit + * + * @bit: the bit of the word being waited on + * @word: the word being waited on, a kernel virtual address + * + * You can use this helper if bitflags are manipulated atomically rather than + * non-atomically under a lock. + */ +static inline void clear_and_wake_up_bit(int bit, void *word) +{ + clear_bit_unlock(bit, word); + /* See wake_up_bit() for which memory barrier you need to use. */ + smp_mb__after_atomic(); + wake_up_bit(word, bit); +} + #endif /* _LINUX_WAIT_BIT_H */ |
