]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
linux-inode-i-mutex-20060214
authorDerrick Brashear <shadow@dementia.org>
Wed, 15 Feb 2006 21:01:49 +0000 (21:01 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 15 Feb 2006 21:01:49 +0000 (21:01 +0000)
new (2.6.16) kernerls have i_mutex instead of i_sem

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

make i_sem become i_mutex

acinclude.m4
src/afs/LINUX/osi_file.c
src/cf/linux-test4.m4

index 24746355090ebe3ebf4af914fdaf51a562d91cfc..fd796892f2b08f6125a192194ff741870c25c47a 100644 (file)
@@ -560,6 +560,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
+                LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED
+                LINUX_FS_STRUCT_INODE_HAS_I_MUTEX
                 LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST
                 LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
                 LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK
index 7711a75fe69e03b51ff180cc5c585a43b861c11f..272d811004b503078af5bfbbc8be1385a9f57e5e 100644 (file)
@@ -204,7 +204,11 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
 #ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
     down_write(&inode->i_alloc_sem);
 #endif
+#ifdef STRUCT_INODE_HAS_I_MUTEX
+    mutex_lock(&inode->i_mutex);
+#else
     down(&inode->i_sem);
+#endif
     newattrs.ia_size = asize;
     newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
 #if defined(AFS_LINUX24_ENV)
@@ -234,7 +238,11 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
     }
 #endif
     code = -code;
+#ifdef STRUCT_INODE_HAS_I_MUTEX
+    mutex_unlock(&inode->i_mutex);
+#else
     up(&inode->i_sem);
+#endif
 #ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
     up_write(&inode->i_alloc_sem);
 #endif
index 27b153eb654ba56b1e2f240e7559dd7b57860fce..e0945389656c8bd0f5d47f6b9e6acb908fba66b7 100644 (file)
@@ -208,7 +208,7 @@ AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
 AC_MSG_CHECKING(for i_devices in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_devices
 [
 AC_TRY_COMPILE(
 [#include <linux/fs.h>],
@@ -299,6 +299,22 @@ AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
 CPPFLAGS="$save_CPPFLAGS"])
 
 
+AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
+AC_MSG_CHECKING(for i_mutex in struct inode)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mutex, 
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode;
+printf("%d\n", _inode.i_mutex);], 
+ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
+ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
 AC_MSG_CHECKING(for i_security in struct inode)
 save_CPPFLAGS="$CPPFLAGS"