2 dnl # Check for direct IO interfaces.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO], [
5 ZFS_LINUX_TEST_SRC([direct_io_iter], [
8 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,
17 ZFS_LINUX_TEST_SRC([direct_io_iter_offset], [
20 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,
29 ZFS_LINUX_TEST_SRC([direct_io_iter_rw_offset], [
32 ssize_t test_direct_IO(int rw, struct kiocb *kiocb,
33 struct iov_iter *iter, loff_t offset) { return 0; }
35 static const struct address_space_operations
36 aops __attribute__ ((unused)) = {
37 .direct_IO = test_direct_IO,
41 ZFS_LINUX_TEST_SRC([direct_io_iovec], [
44 ssize_t test_direct_IO(int rw, struct kiocb *kiocb,
45 const struct iovec *iov, loff_t offset,
46 unsigned long nr_segs) { return 0; }
48 static const struct address_space_operations
49 aops __attribute__ ((unused)) = {
50 .direct_IO = test_direct_IO,
55 AC_DEFUN([ZFS_AC_KERNEL_VFS_DIRECT_IO], [
57 dnl # Linux 4.6.x API change
59 AC_MSG_CHECKING([whether aops->direct_IO() uses iov_iter])
60 ZFS_LINUX_TEST_RESULT([direct_io_iter], [
62 AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER, 1,
63 [aops->direct_IO() uses iov_iter without rw])
68 dnl # Linux 4.1.x API change
71 [whether aops->direct_IO() uses offset])
72 ZFS_LINUX_TEST_RESULT([direct_io_iter_offset], [
74 AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_OFFSET, 1,
75 [aops->direct_IO() uses iov_iter with offset])
81 dnl # Linux 3.16.x API change
84 [whether aops->direct_IO() uses rw and offset])
85 ZFS_LINUX_TEST_RESULT([direct_io_iter_rw_offset], [
87 AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET, 1,
88 [aops->direct_IO() uses iov_iter with ]
94 dnl # Ancient Linux API (predates git)
97 [whether aops->direct_IO() uses iovec])
98 ZFS_LINUX_TEST_RESULT([direct_io_iovec], [
100 AC_DEFINE(HAVE_VFS_DIRECT_IO_IOVEC, 1,
101 [aops->direct_IO() uses iovec])
103 ZFS_LINUX_TEST_ERROR([direct IO])