xref: /freebsd/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
1dnl #
2dnl # Linux 5.14 adds a change to require set_page_dirty to be manually
3dnl # wired up in struct address_space_operations. Determine if this needs
4dnl # to be done. This patch set also introduced __set_page_dirty_nobuffers
5dnl # declaration in linux/pagemap.h, so these tests look for the presence
6dnl # of that function to tell the compiler to assign set_page_dirty in
7dnl # module/os/linux/zfs/zpl_file.c
8dnl #
9AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS], [
10	ZFS_LINUX_TEST_SRC([vfs_has_set_page_dirty_nobuffers], [
11		#include <linux/pagemap.h>
12		#include <linux/fs.h>
13
14		static const struct address_space_operations
15		    aops __attribute__ ((unused)) = {
16			.set_page_dirty = __set_page_dirty_nobuffers,
17		};
18	],[])
19])
20
21AC_DEFUN([ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS], [
22	dnl #
23	dnl # Linux 5.14 change requires set_page_dirty() to be assigned
24	dnl # in address_space_operations()
25	dnl #
26	AC_MSG_CHECKING([__set_page_dirty_nobuffers exists])
27	ZFS_LINUX_TEST_RESULT([vfs_has_set_page_dirty_nobuffers], [
28		AC_MSG_RESULT([yes])
29		AC_DEFINE(HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS, 1,
30			[__set_page_dirty_nobuffers exists])
31	],[
32		AC_MSG_RESULT([no])
33	])
34])
35