From 41902c8e6da1c4dc5c4c12ce041acb4aba188e6f Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 16 Jul 2024 18:27:29 -0600 Subject: Use kmap_local_page instead of kmap_atomic (#16329) Changed zfs_k(un)map_atomic to zfs_k(un)map_local Signed-off-by: Jason Lee Reviewed-by: Alexander Motin Reviewed-by: Brian Atkinson --- config/kernel-kmap-local-page.m4 | 23 +++++++++++++++++++++++ config/kernel.m4 | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 config/kernel-kmap-local-page.m4 (limited to 'config') diff --git a/config/kernel-kmap-local-page.m4 b/config/kernel-kmap-local-page.m4 new file mode 100644 index 000000000..1990914d4 --- /dev/null +++ b/config/kernel-kmap-local-page.m4 @@ -0,0 +1,23 @@ +dnl # +dnl # 5.11 API change +dnl # kmap_atomic() was deprecated in favor of kmap_local_page() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_KMAP_LOCAL_PAGE], [ + ZFS_LINUX_TEST_SRC([kmap_local_page], [ + #include + ],[ + struct page page; + kmap_local_page(&page); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_KMAP_LOCAL_PAGE], [ + AC_MSG_CHECKING([whether kmap_local_page exists]) + ZFS_LINUX_TEST_RESULT([kmap_local_page], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_KMAP_LOCAL_PAGE, 1, + [kernel has kmap_local_page]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index b51477b6a..f282ccd8b 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -125,6 +125,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS + ZFS_AC_KERNEL_SRC_KMAP_LOCAL_PAGE ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT @@ -276,6 +277,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS + ZFS_AC_KERNEL_KMAP_LOCAL_PAGE ZFS_AC_KERNEL_FOLLOW_DOWN_ONE ZFS_AC_KERNEL_MAKE_REQUEST_FN ZFS_AC_KERNEL_GENERIC_IO_ACCT -- cgit v1.2.3