Linux: Fix zfs_prune panics
[zfs.git] / config / kernel-vfs-migrate_folio.m4
blob186cd0581a17fa6232082ba0e2683edfca9d1e03
1 dnl #
2 dnl # Linux 6.0 uses migrate_folio in lieu of migrate_page
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_MIGRATE_FOLIO], [
5         ZFS_LINUX_TEST_SRC([vfs_has_migrate_folio], [
6                 #include <linux/fs.h>
7                 #include <linux/migrate.h>
9                 static const struct address_space_operations
10                     aops __attribute__ ((unused)) = {
11                         .migrate_folio  = migrate_folio,
12                 };
13         ],[])
16 AC_DEFUN([ZFS_AC_KERNEL_VFS_MIGRATE_FOLIO], [
17         dnl #
18         dnl # Linux 6.0 uses migrate_folio in lieu of migrate_page
19         dnl #
20         AC_MSG_CHECKING([whether migrate_folio exists])
21         ZFS_LINUX_TEST_RESULT([vfs_has_migrate_folio], [
22                 AC_MSG_RESULT([yes])
23                 AC_DEFINE(HAVE_VFS_MIGRATE_FOLIO, 1, [migrate_folio exists])
24         ],[
25                 AC_MSG_RESULT([no])
26         ])