xref: /freebsd/sys/contrib/openzfs/config/kernel-readpages.m4 (revision 8ddb146abcdf061be9f2c0db7e391697dafad85c)
1dnl #
2dnl # Linux 5.18 removes address_space_operations ->readpages in favour of
3dnl # ->readahead
4dnl #
5AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_READPAGES], [
6	ZFS_LINUX_TEST_SRC([vfs_has_readpages], [
7		#include <linux/fs.h>
8
9		static const struct address_space_operations
10		    aops __attribute__ ((unused)) = {
11			.readpages = NULL,
12		};
13	],[])
14])
15
16AC_DEFUN([ZFS_AC_KERNEL_VFS_READPAGES], [
17	AC_MSG_CHECKING([whether aops->readpages exists])
18	ZFS_LINUX_TEST_RESULT([vfs_has_readpages], [
19		AC_MSG_RESULT([yes])
20		AC_DEFINE(HAVE_VFS_READPAGES, 1,
21			[address_space_operations->readpages exists])
22	],[
23		AC_MSG_RESULT([no])
24	])
25])
26