ext2-atomic.h 561 B

1234567891011121314151617181920212223242526
  1. #ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
  2. #define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
  3. /*
  4. * Spinlock based version of ext2 atomic bitops
  5. */
  6. #define ext2_set_bit_atomic(lock, nr, addr) \
  7. ({ \
  8. int ret; \
  9. spin_lock(lock); \
  10. ret = __test_and_set_bit_le(nr, addr); \
  11. spin_unlock(lock); \
  12. ret; \
  13. })
  14. #define ext2_clear_bit_atomic(lock, nr, addr) \
  15. ({ \
  16. int ret; \
  17. spin_lock(lock); \
  18. ret = __test_and_clear_bit_le(nr, addr); \
  19. spin_unlock(lock); \
  20. ret; \
  21. })
  22. #endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ */