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