2006-03-26 13:39:16 +04:00
|
|
|
#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
|
|
|
|
#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
|
|
|
|
|
2011-07-27 03:09:04 +04:00
|
|
|
/*
|
|
|
|
* Spinlock based version of ext2 atomic bitops
|
|
|
|
*/
|
|
|
|
|
2006-03-26 13:39:16 +04:00
|
|
|
#define ext2_set_bit_atomic(lock, nr, addr) \
|
|
|
|
({ \
|
|
|
|
int ret; \
|
|
|
|
spin_lock(lock); \
|
2011-03-24 02:42:04 +03:00
|
|
|
ret = __test_and_set_bit_le(nr, addr); \
|
2006-03-26 13:39:16 +04:00
|
|
|
spin_unlock(lock); \
|
|
|
|
ret; \
|
|
|
|
})
|
|
|
|
|
|
|
|
#define ext2_clear_bit_atomic(lock, nr, addr) \
|
|
|
|
({ \
|
|
|
|
int ret; \
|
|
|
|
spin_lock(lock); \
|
2011-03-24 02:42:04 +03:00
|
|
|
ret = __test_and_clear_bit_le(nr, addr); \
|
2006-03-26 13:39:16 +04:00
|
|
|
spin_unlock(lock); \
|
|
|
|
ret; \
|
|
|
|
})
|
|
|
|
|
|
|
|
#endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */
|