From: Derrick Brashear Date: Wed, 15 Feb 2006 21:01:49 +0000 (+0000) Subject: linux-inode-i-mutex-20060214 X-Git-Tag: openafs-devel-1_5_0~17 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=21e0734259ee2c575bfbbd970f2fa84253378267;p=packages%2Fo%2Fopenafs.git linux-inode-i-mutex-20060214 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 --- diff --git a/acinclude.m4 b/acinclude.m4 index 247463550..fd796892f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 7711a75fe..272d81100 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -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 diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 27b153eb6..e09453896 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], @@ -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 ], +[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"