linux-vfs-flush-3arg-20070612
authorMarc Dionne <marc.dionne@technoconseil.com>
Tue, 12 Jun 2007 19:32:19 +0000 (19:32 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 12 Jun 2007 19:32:19 +0000 (19:32 +0000)
FIXES 62203

3rd arg for passing lock owner id. add configure gunk also

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index 6b8b341..ff54715 100644 (file)
@@ -608,6 +608,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA
                 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
+                LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
                 LINUX_AOP_WRITEBACK_CONTROL
                 LINUX_FS_STRUCT_FOP_HAS_FLOCK
                 LINUX_KERNEL_LINUX_SYSCALL_H
@@ -836,6 +837,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
                  AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
                 fi
+                if test "x$ac_cv_linux_func_f_flush_takes_fl_owner_t" = "xyes" ; then
+                 AC_DEFINE(FOP_FLUSH_TAKES_FL_OWNER_T, 1, [define if your fops.flush takes an fl_owner_t argument])
+                fi
                 if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
                  AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
                 fi
index 8eb12f5..4595d17 100644 (file)
@@ -575,7 +575,11 @@ afs_linux_flock(struct file *fp, int cmd, struct file_lock *flp) {
  * afs_StoreAllSegments() with AFS_LASTSTORE
  */
 static int
+#if defined(FOP_FLUSH_TAKES_FL_OWNER_T)
+afs_linux_flush(struct file *fp, fl_owner_t id)
+#else
 afs_linux_flush(struct file *fp)
+#endif
 {
     struct vrequest treq;
     struct vcache *vcp = VTOAFS(FILE_INODE(fp));
index cc0418d..6b7522a 100644 (file)
@@ -850,3 +850,16 @@ register_sysctl_table (t);],
       ac_cv_linux_register_sysctl_table_noflag=no)])
   AC_MSG_RESULT($ac_cv_linux_register_sysctl_table_noflag)])
 
+AC_DEFUN([LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T], [
+  AC_MSG_CHECKING([whether file_operations.flush takes a fl_owner_t])
+  AC_CACHE_VAL([ac_cv_linux_func_f_flush_takes_fl_owner_t], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _inode;
+struct file _file;
+fl_owner_t id;
+(void)_inode.i_fop->flush(&_file, &id);],
+      ac_cv_linux_func_f_flush_takes_fl_owner_t=yes,
+      ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
+