]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-fsync.m4
Linux 3.1 compat, fops->fsync()
[mirror_zfs-debian.git] / config / kernel-fsync.m4
CommitLineData
7268e1be 1dnl #
adcd70bd 2dnl # Linux 2.6.x - 2.6.34 API
7268e1be 3dnl #
adcd70bd 4AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
7268e1be
BB
5 ZFS_LINUX_TRY_COMPILE([
6 #include <linux/fs.h>
7 ],[
adcd70bd 8 int (*fsync) (struct file *, struct dentry *, int) = NULL;
79713039 9 struct file_operations fops __attribute__ ((unused));
7268e1be
BB
10
11 fops.fsync = fsync;
12 ],[
adcd70bd
BB
13 AC_MSG_RESULT([dentry])
14 AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
15 [fops->fsync() with dentry])
7268e1be 16 ],[
7268e1be
BB
17 ])
18])
adcd70bd
BB
19
20dnl #
21dnl # Linux 2.6.35 - Linux 3.0 API
22dnl #
23AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
24 ZFS_LINUX_TRY_COMPILE([
25 #include <linux/fs.h>
26 ],[
27 int (*fsync) (struct file *, int) = NULL;
28 struct file_operations fops __attribute__ ((unused));
29
30 fops.fsync = fsync;
31 ],[
32 AC_MSG_RESULT([no dentry])
33 AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
34 [fops->fsync() without dentry])
35 ],[
36 ])
37])
38
39dnl #
40dnl # Linux 3.1 -x 3.x API
41dnl #
42AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
43 ZFS_LINUX_TRY_COMPILE([
44 #include <linux/fs.h>
45 ],[
46 int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
47 struct file_operations fops __attribute__ ((unused));
48
49 fops.fsync = fsync;
50 ],[
51 AC_MSG_RESULT([range])
52 AC_DEFINE(HAVE_FSYNC_RANGE, 1,
53 [fops->fsync() with range])
54 ],[
55 ])
56])
57
58AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
59 AC_MSG_CHECKING([whether fops->fsync() wants])
60 ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
61 ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
62 ZFS_AC_KERNEL_FSYNC_RANGE
63])