aboutsummaryrefslogtreecommitdiffstats
path: root/include/os
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2024-07-31 18:43:39 +1000
committerBrian Behlendorf <[email protected]>2024-08-13 17:47:18 -0700
commit3abffc8781ddd8a49434ec6cadf10c68bb699533 (patch)
treef20ad13d4732d0d1f77668e41df8c65675530e39 /include/os
parentf5236fe47ac0d4be84089651a19a2f5b713f9798 (diff)
Linux 6.11: add compat macro for page_mapping()
Since the change to folios it has just been a wrapper anyway. Linux has removed their wrapper, so we add one. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #16400
Diffstat (limited to 'include/os')
-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 */