]> granicus.if.org Git - zfs/commitdiff
Remove vfs_fsync() wrapper
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 Oct 2014 18:52:47 +0000 (14:52 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 22:11:52 +0000 (15:11 -0700)
The vfs_fsync() function has been available since Linux 2.6.29.
There is no longer a need to maintain this compatibility code.
However, the HAVE_2ARGS_VFS_FSYNC check was left in place
since that change occured after 2.6.32.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
config/spl-build.m4
include/linux/file_compat.h

index 6c34b99993977b3834f3c9e0783ebc99bc2dd385..5a33f5e8ee8e0440e694680bc8d3981c29245041 100644 (file)
@@ -31,7 +31,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_SET_FS_PWD_WITH_CONST
        SPL_AC_2ARGS_VFS_UNLINK
        SPL_AC_4ARGS_VFS_RENAME
-       SPL_AC_VFS_FSYNC
        SPL_AC_2ARGS_VFS_FSYNC
        SPL_AC_INODE_TRUNCATE_RANGE
        SPL_AC_FS_STRUCT_SPINLOCK
@@ -1178,24 +1177,6 @@ AC_DEFUN([SPL_AC_PUT_TASK_STRUCT],
        ])
 ])
 
-dnl #
-dnl # 2.6.29 API change,
-dnl # vfs_fsync() funcation added, prior to this use file_fsync().
-dnl #
-AC_DEFUN([SPL_AC_VFS_FSYNC],
-       [AC_MSG_CHECKING([whether vfs_fsync() is available])
-       SPL_LINUX_TRY_COMPILE_SYMBOL([
-               #include <linux/fs.h>
-       ], [
-               (void) vfs_fsync;
-       ], [vfs_fsync], [fs/sync.c], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_VFS_FSYNC, 1, [vfs_fsync() is available])
-       ], [
-               AC_MSG_RESULT(no)
-       ])
-])
-
 dnl #
 dnl # 2.6.35 API change,
 dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
index 09d0e825011f2e402c3b8f2c88543e7ee8c6a2de..a2db2590a23554e7fc56fa841e79c58793275e8e 100644 (file)
@@ -59,27 +59,22 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
        if (fp->f_op->fallocate)
                error = fp->f_op->fallocate(fp, mode, offset, len);
 #else
-# ifdef HAVE_INODE_FALLOCATE
+#ifdef HAVE_INODE_FALLOCATE
        if (fp->f_dentry && fp->f_dentry->d_inode &&
            fp->f_dentry->d_inode->i_op->fallocate)
                error = fp->f_dentry->d_inode->i_op->fallocate(
                    fp->f_dentry->d_inode, mode, offset, len);
-# endif /* HAVE_INODE_FALLOCATE */
+#endif /* HAVE_INODE_FALLOCATE */
 #endif /*HAVE_FILE_FALLOCATE */
 
        return (error);
 }
 
-#ifdef HAVE_VFS_FSYNC
-# ifdef HAVE_2ARGS_VFS_FSYNC
-#  define spl_filp_fsync(fp, sync)     vfs_fsync(fp, sync)
-# else
-#  define spl_filp_fsync(fp, sync)     vfs_fsync(fp, (fp)->f_dentry, sync)
-# endif /* HAVE_2ARGS_VFS_FSYNC */
+#ifdef HAVE_2ARGS_VFS_FSYNC
+#define        spl_filp_fsync(fp, sync)        vfs_fsync(fp, sync)
 #else
-# include <linux/buffer_head.h>
-# define spl_filp_fsync(fp, sync)      file_fsync(fp, (fp)->f_dentry, sync)
-#endif /* HAVE_VFS_FSYNC */
+#define        spl_filp_fsync(fp, sync)        vfs_fsync(fp, (fp)->f_dentry, sync)
+#endif /* HAVE_2ARGS_VFS_FSYNC */
 
 #define        spl_inode_lock(ip)              mutex_lock(&(ip)->i_mutex)
 #define        spl_inode_unlock(ip)            mutex_unlock(&(ip)->i_mutex)