]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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 1a1aa2a3c0eb9133f079b5bab59cb6a9cecf8aca..0979d194f26ad358fc7b64e24ce517e424324446 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 b7ed3ce44717d5c8e9fe68275d54694f19309176..5087e39d5738410db808cefc03c55b19c04c6fd5 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 b7b38191e516ac04202ef2e28ffee1ba503fe263..c206ebe023a55ec54d030fa3f74b7b3e1a4cf2ba 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 c7a7f2e06cefe93751760760ae3b1b2f86ca4747..beefbae3f6583c99a6edaaef83c13069fe2124a1 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"])
+