From 0fb256419d48beadc6236481b6b27839e6ad6dd9 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Thu, 14 Apr 2005 02:14:21 +0000 Subject: [PATCH] linux-inotify-sem-20050413 FIXES 18260 add inotify sem detection --- acinclude.m4 | 1 + src/afs/afs_vcache.c | 6 +++++- src/cf/linux-test4.m4 | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 5aac39851d..56869efd2d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -570,6 +570,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST LINUX_FS_STRUCT_INODE_HAS_I_SECURITY LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK + LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM LINUX_INODE_SETATTR_RETURN_TYPE LINUX_WRITE_INODE_RETURN_TYPE LINUX_IOP_NAMEIDATA diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 74957b3eb6..d3167fad3b 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -933,9 +933,13 @@ restart: #ifdef STRUCT_INODE_HAS_I_SB_LIST list_add(&ip->i_sb_list, &ip->i_sb->s_inodes); #endif -#ifdef STRUCT_INODE_HAS_INOTIFY_LOCK +#if defined(STRUCT_INODE_HAS_INOTIFY_LOCK) || defined(STRUCT_INODE_HAS_INOTIFY_SEM) INIT_LIST_HEAD(&ip->inotify_watches); +#if defined(STRUCT_INODE_HAS_INOTIFY_SEM) + sema_init(&ip->inotify_sem); +#else spin_lock_init(&ip->inotify_lock); +#endif #endif } #endif diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index fa80d54c52..ffb96e42b0 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -251,6 +251,21 @@ ac_cv_linux_fs_struct_inode_has_inotify_lock=no)]) AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock) CPPFLAGS="$save_CPPFLAGS"]) +AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [ +AC_MSG_CHECKING(for inotify_sem in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_inotify_sem, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%x\n", _inode.inotify_sem);], +ac_cv_linux_fs_struct_inode_has_inotify_sem=yes, +ac_cv_linux_fs_struct_inode_has_inotify_sem=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem) +CPPFLAGS="$save_CPPFLAGS"]) + AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [ AC_MSG_CHECKING(for i_mapping_overload in struct inode)