aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/os/linux/kernel/linux/mm_compat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/os/linux/kernel/linux/mm_compat.h b/include/os/linux/kernel/linux/mm_compat.h
index 40056c68d..817f6df42 100644
--- a/include/os/linux/kernel/linux/mm_compat.h
+++ b/include/os/linux/kernel/linux/mm_compat.h
@@ -21,16 +21,23 @@
/*
* Copyright (c) 2023, 2024, Klara Inc.
+ * Copyright (c) 2024, Rob Norris <[email protected]>
*/
#ifndef _ZFS_MM_COMPAT_H
#define _ZFS_MM_COMPAT_H
#include <linux/mm.h>
+#include <linux/pagemap.h>
/* 5.4 introduced page_size(). Older kernels can use a trivial macro instead */
#ifndef HAVE_MM_PAGE_SIZE
#define page_size(p) ((unsigned long)(PAGE_SIZE << compound_order(p)))
#endif
+/* 6.11 removed page_mapping(). A simple wrapper around folio_mapping() works */
+#ifndef HAVE_MM_PAGE_MAPPING
+#define page_mapping(p) folio_mapping(page_folio(p))
+#endif
+
#endif /* _ZFS_MM_COMPAT_H */