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