diff --git a/acinclude.m4 b/acinclude.m4 index 71d3aee370..811e2d3042 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 1a54b80634..61f7bbf10e 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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)); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 099d3c796f..51b9e2e9f6 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], +[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)]) +