Linux: 2.6.35 - fsync no longer takes a dentry
authorMarc Dionne <marc.c.dionne@gmail.com>
Fri, 28 May 2010 21:48:12 +0000 (17:48 -0400)
committerDerrick Brashear <shadow@dementia.org>
Sun, 30 May 2010 04:46:22 +0000 (21:46 -0700)
In 2.6.35, the fsync file operations drops the dentry argument.
Add a configure test and cope.

Change-Id: Iaf660808d52688a4a8fd53a76d8d055602f746b9
Reviewed-on: http://gerrit.openafs.org/2064
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>

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

index fdb7f3e..e65c0cd 100644 (file)
@@ -897,6 +897,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
                 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
+                LINUX_FOP_F_FSYNC_TAKES_DENTRY
                 LINUX_AOP_WRITEBACK_CONTROL
                 LINUX_FS_STRUCT_FOP_HAS_SPLICE
                 LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG
index eb667cc..8c42134 100644 (file)
@@ -450,7 +450,11 @@ afs_linux_release(struct inode *ip, struct file *fp)
 }
 
 static int
+#if defined(FOP_FSYNC_TAKES_DENTRY)
 afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync)
+#else
+afs_linux_fsync(struct file *fp, int datasync)
+#endif
 {
     int code;
     struct inode *ip = FILE_INODE(fp);
index bc62aec..16ea872 100644 (file)
@@ -376,6 +376,19 @@ fl_owner_t id;
 ])
 
 
+AC_DEFUN([LINUX_FOP_F_FSYNC_TAKES_DENTRY], [
+  AC_CHECK_LINUX_BUILD([whether file_operations.fsync takes a dentry argument],
+                      [ac_cv_linux_func_f_fsync_takes_dentry],
+                      [#include <linux/fs.h>],
+[struct inode _inode;
+struct file _file;
+struct dentry _d;
+(void)_inode.i_fop->fsync(&_file, &_d, 0);],
+                      [FOP_FSYNC_TAKES_DENTRY],
+                      [define if your fops.fsync takes an dentry argument])
+])
+
+
 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
   AC_CHECK_LINUX_BUILD([whether kmem_cache_t exists],
                       [ac_cv_linux_have_kmem_cache_t],