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

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

(cherry picked from commit 6eabfbd4b969d9efcc1eef646899af28a5077f0f)

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

index 71d3aee..811e2d3 100644 (file)
@@ -623,6 +623,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
@@ -851,6 +852,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 1a54b80..61f7bbf 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 099d3c7..51b9e2e 100644 (file)
@@ -858,3 +858,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)])
+