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