Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / include / asm-generic / bitops / ext2-atomic.h
blob87f0f109d7f1db4eb34ab11744bd30031daab69b
1 #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
2 #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
4 /*
5 * Spinlock based version of ext2 atomic bitops
6 */
8 #define ext2_set_bit_atomic(lock, nr, addr) \
9 ({ \
10 int ret; \
11 spin_lock(lock); \
12 ret = __test_and_set_bit_le(nr, addr); \
13 spin_unlock(lock); \
14 ret; \
17 #define ext2_clear_bit_atomic(lock, nr, addr) \
18 ({ \
19 int ret; \
20 spin_lock(lock); \
21 ret = __test_and_clear_bit_le(nr, addr); \
22 spin_unlock(lock); \
23 ret; \
26 #endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */