From 6650b683bf999293d3473d0f7e2dd3fd4dc0daf7 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sun, 20 Mar 2005 20:37:39 +0000 Subject: [PATCH] linux-inotify-20050320 yay more inode fields. --- acinclude.m4 | 4 ++++ src/afs/afs_vcache.c | 4 ++++ src/cf/linux-test4.m4 | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 2d041795c3..fb5909c683 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -571,6 +571,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_FS_STRUCT_INODE_HAS_I_DEVICES LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST LINUX_FS_STRUCT_INODE_HAS_I_SECURITY + LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK LINUX_INODE_SETATTR_RETURN_TYPE LINUX_WRITE_INODE_RETURN_TYPE LINUX_IOP_NAMEIDATA @@ -690,6 +691,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers]) fi + if test "x$ac_cv_linux_fs_struct_inode_has_inotify_lock" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_INOTIFY_LOCK, 1, [define if your struct inode has inotify_lock]) + fi if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void]) fi diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index be1fc0bd04..3eb083013c 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -957,6 +957,10 @@ 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 + INIT_LIST_HEAD(&inode->inotify_watches); + spin_lock_init(&inode->inotify_lock); +#endif } #endif diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 4da0611b00..fa80d54c52 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -236,6 +236,22 @@ AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers) CPPFLAGS="$save_CPPFLAGS"]) +AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [ +AC_MSG_CHECKING(for inotify_lock 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_lock, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.inotify_lock);], +ac_cv_linux_fs_struct_inode_has_inotify_lock=yes, +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_I_MAPPING_OVERLOAD], [ AC_MSG_CHECKING(for i_mapping_overload in struct inode) save_CPPFLAGS="$CPPFLAGS"