c56530055a
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 lines
505 B
C
22 lines
505 B
C
#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
|
|
#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
|
|
|
|
#define ext2_set_bit_atomic(lock, nr, addr) \
|
|
({ \
|
|
int ret; \
|
|
spin_lock(lock); \
|
|
ret = __test_and_set_bit_le(nr, addr); \
|
|
spin_unlock(lock); \
|
|
ret; \
|
|
})
|
|
|
|
#define ext2_clear_bit_atomic(lock, nr, addr) \
|
|
({ \
|
|
int ret; \
|
|
spin_lock(lock); \
|
|
ret = __test_and_clear_bit_le(nr, addr); \
|
|
spin_unlock(lock); \
|
|
ret; \
|
|
})
|
|
|
|
#endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */
|