git: 70b97048a051 - main - LinuxKPI: mm.h: implement virt_to_head_page()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 05 Feb 2023 20:31:10 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=70b97048a051958be37b650b8a67c89203fd6b70

commit 70b97048a051958be37b650b8a67c89203fd6b70
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-01-28 16:00:55 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-02-05 20:29:56 +0000

    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 40f63c2cffdf..2dcf32cbe84a 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.