1dnl # 2dnl # Check for available iov_iter functionality. 3dnl # 4AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [ 5 ZFS_LINUX_TEST_SRC([fault_in_iov_iter_readable], [ 6 #include <linux/fs.h> 7 #include <linux/uio.h> 8 ],[ 9 struct iov_iter iter = { 0 }; 10 size_t size = 512; 11 int error __attribute__ ((unused)); 12 13 error = fault_in_iov_iter_readable(&iter, size); 14 ]) 15 16 ZFS_LINUX_TEST_SRC([iov_iter_type], [ 17 #include <linux/fs.h> 18 #include <linux/uio.h> 19 ],[ 20 struct iov_iter iter = { 0 }; 21 __attribute__((unused)) enum iter_type i = iov_iter_type(&iter); 22 ]) 23 24 ZFS_LINUX_TEST_SRC([iov_iter_get_pages2], [ 25 #include <linux/uio.h> 26 ],[ 27 struct iov_iter iter = { 0 }; 28 struct page **pages = NULL; 29 size_t maxsize = 4096; 30 unsigned maxpages = 1; 31 size_t start; 32 size_t ret __attribute__ ((unused)); 33 34 ret = iov_iter_get_pages2(&iter, pages, maxsize, maxpages, 35 &start); 36 ]) 37 38 ZFS_LINUX_TEST_SRC([iter_is_ubuf], [ 39 #include <linux/uio.h> 40 ],[ 41 struct iov_iter iter = { 0 }; 42 bool ret __attribute__((unused)); 43 44 ret = iter_is_ubuf(&iter); 45 ]) 46 47 ZFS_LINUX_TEST_SRC([iter_iov], [ 48 #include <linux/fs.h> 49 #include <linux/uio.h> 50 ],[ 51 struct iov_iter iter = { 0 }; 52 __attribute__((unused)) const struct iovec *iov = iter_iov(&iter); 53 ]) 54]) 55 56AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [ 57 58 AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available]) 59 ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [ 60 AC_MSG_RESULT(yes) 61 AC_DEFINE(HAVE_FAULT_IN_IOV_ITER_READABLE, 1, 62 [fault_in_iov_iter_readable() is available]) 63 ],[ 64 AC_MSG_RESULT(no) 65 ]) 66 67 dnl # 68 dnl # This checks for iov_iter_type() in linux/uio.h. It is not 69 dnl # required, however, and the module will compiled without it 70 dnl # using direct access of the member attribute 71 dnl # 72 AC_MSG_CHECKING([whether iov_iter_type() is available]) 73 ZFS_LINUX_TEST_RESULT([iov_iter_type], [ 74 AC_MSG_RESULT(yes) 75 AC_DEFINE(HAVE_IOV_ITER_TYPE, 1, 76 [iov_iter_type() is available]) 77 ],[ 78 AC_MSG_RESULT(no) 79 ]) 80 81 82 dnl # 83 dnl # Kernel 6.0 changed iov_iter_get_pages() to iov_iter_get_pages2(). 84 dnl # 85 AC_MSG_CHECKING([whether iov_iter_get_pages2() is available]) 86 ZFS_LINUX_TEST_RESULT([iov_iter_get_pages2], [ 87 AC_MSG_RESULT(yes) 88 AC_DEFINE(HAVE_IOV_ITER_GET_PAGES2, 1, 89 [iov_iter_get_pages2() is available]) 90 ],[ 91 AC_MSG_RESULT(no) 92 ]) 93 94 dnl # 95 dnl # Kernel 6.0 introduced the ITER_UBUF iov_iter type. iter_is_ubuf() 96 dnl # was also added to determine if the iov_iter is an ITER_UBUF. 97 dnl # 98 AC_MSG_CHECKING([whether iter_is_ubuf() is available]) 99 ZFS_LINUX_TEST_RESULT([iter_is_ubuf], [ 100 AC_MSG_RESULT(yes) 101 AC_DEFINE(HAVE_ITER_IS_UBUF, 1, [iter_is_ubuf() is available]) 102 ],[ 103 AC_MSG_RESULT(no) 104 ]) 105 106 dnl # 107 dnl # Kernel 6.5 introduces the iter_iov() function that returns the 108 dnl # __iov member of an iov_iter*. The iov member was renamed to this 109 dnl # __iov member, and is intended to be accessed via the helper 110 dnl # function now. 111 dnl # 112 AC_MSG_CHECKING([whether iter_iov() is available]) 113 ZFS_LINUX_TEST_RESULT([iter_iov], [ 114 AC_MSG_RESULT(yes) 115 AC_DEFINE(HAVE_ITER_IOV, 1, 116 [iter_iov() is available]) 117 ],[ 118 AC_MSG_RESULT(no) 119 ]) 120]) 121