One line patch to initialize spin lock added in a RedHat kernel patch.
This should fix the RedHat 7.1 SMP problem. Also includes configure
glue to turn it on. Thanks to Chaskiel Grundman for suggesting the fix,
Garry Zacheiss for suggesting it affected the SMP kernel generally and not
just SMP hardware, and Andrei Maslennikov for noting the problem did not
affect vanilla 2.4.3 with only the Alan Cox (AC14 in this case) patch.
#undef INODE_SETATTR_NOT_VOID
#undef STRUCT_INODE_HAS_I_BYTES
+#undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
AC_MSG_RESULT(linux)
if test "x$enable_kernel_module" = "xyes"; then
LINUX_FS_STRUCT_INODE_HAS_I_BYTES
+ LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
LINUX_INODE_SETATTR_RETURN_TYPE
LINUX_NEED_RHCONFIG
LINUX_WHICH_MODULES
if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then
AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
fi
+ if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
+ AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
+ fi
:
fi
;;
sema_init(&ip->i_zombie, 1);
init_waitqueue_head(&ip->i_wait);
spin_lock_init(&ip->i_data.i_shared_lock);
+#ifdef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+ spin_lock_init(&ip->i_data.page_lock);
+#endif
INIT_LIST_HEAD(&ip->i_data.clean_pages);
INIT_LIST_HEAD(&ip->i_data.dirty_pages);
INIT_LIST_HEAD(&ip->i_data.locked_pages);
AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)
CPPFLAGS="$save_CPPFLAGS"])
+AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [
+AC_MSG_CHECKING(for page_lock in struct address_space)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct address_space _a_s;
+printf("%x\n", _a_s.page_lock);],
+ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
+ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)
+CPPFLAGS="$save_CPPFLAGS"])
+