linux24-handle-inode-address-space-page-lock-spinlock-20010712
authorDerrick Brashear <shadow@dementia.org>
Thu, 12 Jul 2001 16:37:31 +0000 (16:37 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 12 Jul 2001 16:37:31 +0000 (16:37 +0000)
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.

acconfig.h
configure.in
src/afs/afs_vcache.c
src/cf/linux-test2.m4

index 1a1aa2a..0979d19 100644 (file)
@@ -29,3 +29,4 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 
 #undef INODE_SETATTR_NOT_VOID
 #undef STRUCT_INODE_HAS_I_BYTES
+#undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
index b7ed3ce..5087e39 100644 (file)
@@ -91,6 +91,7 @@ case $system in
                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
@@ -100,6 +101,9 @@ case $system in
                 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
                 ;;
index b7b3819..c206ebe 100644 (file)
@@ -951,6 +951,9 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
        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);
index c7a7f2e..beefbae 100644 (file)
@@ -13,3 +13,18 @@ ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
 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"])
+