Fix O_APPEND for Linux 3.15 and older kernels
[zfs.git] / config / kernel-fsync.m4
blobd198191d3ab9c451ab9f3ee0d7b5163af7b5a746
1 dnl #
2 dnl # Check file_operations->fsync interface.
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
5         ZFS_LINUX_TEST_SRC([fsync_without_dentry], [
6                 #include <linux/fs.h>
8                 int test_fsync(struct file *f, int x) { return 0; }
10                 static const struct file_operations
11                     fops __attribute__ ((unused)) = {
12                         .fsync = test_fsync,
13                 };
14         ],[])
16         ZFS_LINUX_TEST_SRC([fsync_range], [
17                 #include <linux/fs.h>
19                 int test_fsync(struct file *f, loff_t a, loff_t b, int c)
20                     { return 0; }
22                 static const struct file_operations
23                     fops __attribute__ ((unused)) = {
24                         .fsync = test_fsync,
25                 };
26         ],[])
29 AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
30         dnl #
31         dnl # Linux 2.6.35 - Linux 3.0 API
32         dnl #
33         AC_MSG_CHECKING([whether fops->fsync() wants no dentry])
34         ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [
35                 AC_MSG_RESULT([yes])
36                 AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
37                     [fops->fsync() without dentry])
38         ],[
39                 AC_MSG_RESULT([no])
41                 dnl #
42                 dnl # Linux 3.1 - 3.x API
43                 dnl #
44                 AC_MSG_CHECKING([whether fops->fsync() wants range])
45                 ZFS_LINUX_TEST_RESULT([fsync_range], [
46                         AC_MSG_RESULT([range])
47                         AC_DEFINE(HAVE_FSYNC_RANGE, 1,
48                             [fops->fsync() with range])
49                 ],[
50                         ZFS_LINUX_TEST_ERROR([fops->fsync])
51                 ])
52         ])