-dnl #
-dnl # 2.6.33 API change. Also backported in RHEL5 as of 2.6.18-190.el5.
-dnl # Earlier versions of rwsem_is_locked() were inline and had a race
-dnl # condition. The fixed version is exported as a symbol. The race
-dnl # condition is fixed by acquiring sem->wait_lock, so we must not
-dnl # call that version while holding sem->wait_lock.
-dnl #
-AC_DEFUN([SPL_AC_EXPORTED_RWSEM_IS_LOCKED],
- [AC_MSG_CHECKING([whether rwsem_is_locked() acquires sem->wait_lock])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/rwsem.h>
- int rwsem_is_locked(struct rw_semaphore *sem) { return 0; }
- ], [], [rwsem_is_locked], [lib/rwsem-spinlock.c], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(RWSEM_IS_LOCKED_TAKES_WAIT_LOCK, 1,
- [rwsem_is_locked() acquires sem->wait_lock])
- ], [
- AC_MSG_RESULT(no)
- ])
-])
-