ext2-atomic.h 505 B

1234567891011121314151617181920212223
  1. #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
  2. #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
  3. #define ext2_set_bit_atomic(lock, nr, addr) \
  4. ({ \
  5. int ret; \
  6. spin_lock(lock); \
  7. ret = __test_and_set_bit_le(nr, addr); \
  8. spin_unlock(lock); \
  9. ret; \
  10. })
  11. #define ext2_clear_bit_atomic(lock, nr, addr) \
  12. ({ \
  13. int ret; \
  14. spin_lock(lock); \
  15. ret = __test_and_clear_bit_le(nr, addr); \
  16. spin_unlock(lock); \
  17. ret; \
  18. })
  19. #endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */