linux-inotify-sem-20050413
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Thu, 14 Apr 2005 02:14:21 +0000 (02:14 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 14 Apr 2005 02:14:21 +0000 (02:14 +0000)
FIXES 18260

add inotify sem detection

acinclude.m4
src/afs/afs_vcache.c
src/cf/linux-test4.m4

index 5aac398..56869ef 100644 (file)
@@ -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
index 74957b3..d3167fa 100644 (file)
@@ -933,10 +933,14 @@ 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
 
index fa80d54..ffb96e4 100644 (file)
@@ -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 <linux/fs.h>],
+[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)