From 70b97048a051958be37b650b8a67c89203fd6b70 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sat, 28 Jan 2023 16:00:55 +0000 Subject: [PATCH] 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 --- sys/compat/linuxkpi/common/include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 40f63c2cffd..2dcf32cbe84 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -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.