Update ABD stats for linear page Linux
[zfs.git] / config / kernel-vfs-direct_IO.m4
blob17605a13fdef547136b97d66388557883bf376a6
1 dnl #
2 dnl # Check for Direct I/O interfaces.
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO], [
5         ZFS_LINUX_TEST_SRC([direct_io_iter], [
6                 #include <linux/fs.h>
8                 static ssize_t test_direct_IO(struct kiocb *kiocb,
9                     struct iov_iter *iter) { return 0; }
11                 static const struct address_space_operations
12                     aops __attribute__ ((unused)) = {
13                         .direct_IO = test_direct_IO,
14                 };
15         ],[])
17         ZFS_LINUX_TEST_SRC([direct_io_iter_offset], [
18                 #include <linux/fs.h>
20                 static ssize_t test_direct_IO(struct kiocb *kiocb,
21                     struct iov_iter *iter, loff_t offset) { return 0; }
23                 static const struct address_space_operations
24                     aops __attribute__ ((unused)) = {
25                         .direct_IO = test_direct_IO,
26                 };
27         ],[])
30 AC_DEFUN([ZFS_AC_KERNEL_VFS_DIRECT_IO], [
31         dnl #
32         dnl # Linux 4.6.x API change
33         dnl #
34         AC_MSG_CHECKING([whether aops->direct_IO() uses iov_iter])
35         ZFS_LINUX_TEST_RESULT([direct_io_iter], [
36                 AC_MSG_RESULT([yes])
37                 AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER, 1,
38                     [aops->direct_IO() uses iov_iter without rw])
39         ],[
40                 AC_MSG_RESULT([no])
42                 dnl #
43                 dnl # Linux 4.1.x API change
44                 dnl #
45                 AC_MSG_CHECKING(
46                     [whether aops->direct_IO() uses offset])
47                 ZFS_LINUX_TEST_RESULT([direct_io_iter_offset], [
48                         AC_MSG_RESULT([yes])
49                         AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_OFFSET, 1,
50                             [aops->direct_IO() uses iov_iter with offset])
52                 ],[
53                         AC_MSG_RESULT([no])
54                         ZFS_LINUX_TEST_ERROR([Direct I/O])
55                 ])
56         ])