SLES10 Fixes (part 3):

- Configure check for mutex_lock_nested().  This function was introduced
  as part of the mutex validator in 2.6.18, but if it's unavailable then
  it's safe to fallback to a plain mutex_lock().
This commit is contained in:
Brian Behlendorf
2009-05-20 10:56:13 -07:00
parent 96dded3844
commit 6c9433c150
6 changed files with 107 additions and 0 deletions
+23
View File
@@ -705,6 +705,29 @@ AC_DEFUN([SPL_AC_INODE_I_MUTEX], [
])
])
dnl #
dnl # 2.6.18 API change,
dnl # First introduced 'mutex_lock_nested()' in include/linux/mutex.h,
dnl # as part of the mutex validator. Fallback to using 'mutex_lock()'
dnl # if the mutex validator is disabled or otherwise unavailable.
dnl #
AC_DEFUN([SPL_AC_MUTEX_LOCK_NESTED], [
AC_MSG_CHECKING([whether mutex_lock_nested() is available])
SPL_LINUX_TRY_COMPILE([
#include <linux/mutex.h>
],[
struct mutex mutex;
mutex_init(&mutex);
mutex_lock_nested(&mutex, 0);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MUTEX_LOCK_NESTED, 1,
[mutex_lock_nested() is available])
],[
AC_MSG_RESULT(no)
])
])
dnl #
dnl # 2.6.22 API change,
dnl # First introduced 'div64_64()' in lib/div64.c