aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2023-01-28 16:00:55 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2023-02-17 23:42:14 +0000
commit1984e6e4f1583ad1a44b6913e8722121fabe8967 (patch)
treec9c5b3f7345be58edd51e9d5d8995ac84eed9df0
parent75727a02155af29167a6d460de5ce6a9d52e26d8 (diff)
downloadsrc-1984e6e4f1583ad1a44b6913e8722121fabe8967.tar.gz
src-1984e6e4f1583ad1a44b6913e8722121fabe8967.zip
LinuxKPI: mm.h: implement virt_to_head_page()
Implement virt_to_head_page(). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38240 (cherry picked from commit 70b97048a051958be37b650b8a67c89203fd6b70)
-rw-r--r--sys/compat/linuxkpi/common/include/linux/mm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
index c1011b56fe24..49c961886678 100644
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -41,6 +41,7 @@
#include <linux/list.h>
#include <linux/mmap_lock.h>
#include <linux/shrinker.h>
+#include <linux/page.h>
#include <asm/pgtable.h>
@@ -151,6 +152,13 @@ struct sysinfo {
uint32_t mem_unit; /* Memory unit size in bytes */
};
+static inline struct page *
+virt_to_head_page(const void *p)
+{
+
+ return (virt_to_page(p));
+}
+
/*
* Compute log2 of the power of two rounded up count of pages
* needed for size bytes.