2 dnl # Check for available iov_iter functionality.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
5 ZFS_LINUX_TEST_SRC([fault_in_iov_iter_readable], [
9 struct iov_iter iter = { 0 };
11 int error __attribute__ ((unused));
13 error = fault_in_iov_iter_readable(&iter, size);
16 ZFS_LINUX_TEST_SRC([iov_iter_get_pages2], [
17 #include <linux/uio.h>
19 struct iov_iter iter = { 0 };
20 struct page **pages = NULL;
21 size_t maxsize = 4096;
22 unsigned maxpages = 1;
24 size_t ret __attribute__ ((unused));
26 ret = iov_iter_get_pages2(&iter, pages, maxsize, maxpages,
30 ZFS_LINUX_TEST_SRC([iov_iter_get_pages], [
31 #include <linux/uio.h>
33 struct iov_iter iter = { 0 };
34 struct page **pages = NULL;
35 size_t maxsize = 4096;
36 unsigned maxpages = 1;
38 size_t ret __attribute__ ((unused));
40 ret = iov_iter_get_pages(&iter, pages, maxsize, maxpages,
44 ZFS_LINUX_TEST_SRC([iov_iter_type], [
46 #include <linux/uio.h>
48 struct iov_iter iter = { 0 };
49 __attribute__((unused)) enum iter_type i = iov_iter_type(&iter);
52 ZFS_LINUX_TEST_SRC([iter_iov], [
54 #include <linux/uio.h>
56 struct iov_iter iter = { 0 };
57 __attribute__((unused)) const struct iovec *iov = iter_iov(&iter);
61 AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
62 enable_vfs_iov_iter="yes"
64 AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available])
65 ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [
67 AC_DEFINE(HAVE_FAULT_IN_IOV_ITER_READABLE, 1,
68 [fault_in_iov_iter_readable() is available])
74 dnl # Kernel 6.0 changed iov_iter_get_pages() to iov_iter_page_pages2().
76 AC_MSG_CHECKING([whether iov_iter_get_pages2() is available])
77 ZFS_LINUX_TEST_RESULT([iov_iter_get_pages2], [
79 AC_DEFINE(HAVE_IOV_ITER_GET_PAGES2, 1,
80 [iov_iter_get_pages2() is available])
83 AC_MSG_CHECKING([whether iov_iter_get_pages() is available])
84 ZFS_LINUX_TEST_RESULT([iov_iter_get_pages], [
86 AC_DEFINE(HAVE_IOV_ITER_GET_PAGES, 1,
87 [iov_iter_get_pages() is available])
90 enable_vfs_iov_iter="no"
95 dnl # This checks for iov_iter_type() in linux/uio.h. It is not
96 dnl # required, however, and the module will compiled without it
97 dnl # using direct access of the member attribute
99 AC_MSG_CHECKING([whether iov_iter_type() is available])
100 ZFS_LINUX_TEST_RESULT([iov_iter_type], [
102 AC_DEFINE(HAVE_IOV_ITER_TYPE, 1,
103 [iov_iter_type() is available])
109 dnl # As of the 4.9 kernel support is provided for iovecs, kvecs,
110 dnl # bvecs and pipes in the iov_iter structure. As long as the
111 dnl # other support interfaces are all available the iov_iter can
112 dnl # be correctly used in the uio structure.
114 AS_IF([test "x$enable_vfs_iov_iter" = "xyes"], [
115 AC_DEFINE(HAVE_VFS_IOV_ITER, 1,
116 [All required iov_iter interfaces are available])
120 dnl # Kernel 6.5 introduces the iter_iov() function that returns the
121 dnl # __iov member of an iov_iter*. The iov member was renamed to this
122 dnl # __iov member, and is intended to be accessed via the helper
125 AC_MSG_CHECKING([whether iter_iov() is available])
126 ZFS_LINUX_TEST_RESULT([iter_iov], [
128 AC_DEFINE(HAVE_ITER_IOV, 1,
129 [iter_iov() is available])