diff --git a/acconfig.h b/acconfig.h index 548d496aff..95ed141944 100644 --- a/acconfig.h +++ b/acconfig.h @@ -31,6 +31,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #undef INODE_SETATTR_NOT_VOID #undef STRUCT_INODE_HAS_I_BYTES #undef STRUCT_INODE_HAS_I_CDEV +#undef STRUCT_INODE_HAS_I_TRUNCATE_SEM #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK /* glue for RedHat kernel bug */ diff --git a/configure.in b/configure.in index e0ae300113..3313675450 100644 --- a/configure.in +++ b/configure.in @@ -112,6 +112,7 @@ case $system in LINUX_FS_STRUCT_INODE_HAS_I_BYTES LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK LINUX_FS_STRUCT_INODE_HAS_I_CDEV + LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM LINUX_INODE_SETATTR_RETURN_TYPE LINUX_NEED_RHCONFIG LINUX_WHICH_MODULES @@ -121,6 +122,9 @@ case $system in if test "x$ac_cv_linux_fs_struct_inode_has_i_cdev" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_CDEV) fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM) + fi if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_BYTES) fi diff --git a/src/afs/LINUX/osi_vfs.h b/src/afs/LINUX/osi_vfs.h index 30d14fce3d..e390f6a807 100644 --- a/src/afs/LINUX/osi_vfs.h +++ b/src/afs/LINUX/osi_vfs.h @@ -54,6 +54,9 @@ typedef struct vnode { unsigned short i_bytes; #endif struct semaphore i_sem; +#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM + struct rw_semaphore i_truncate_sem; +#endif #if defined(AFS_LINUX24_ENV) struct semaphore i_zombie; #else diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 1755b3187a..de9c468040 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -12,3 +12,18 @@ ac_cv_linux_fs_struct_inode_has_i_cdev=yes, ac_cv_linux_fs_struct_inode_has_i_cdev=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev) CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [ +AC_MSG_CHECKING(for i_truncate_sem in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_truncate_sem);], +ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes, +ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem) +CPPFLAGS="$save_CPPFLAGS"])