summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-03-26 23:28:22 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-04-26 06:56:18 +0300
commit5beaee54a324ba1fe307e341ec825d5d099f4091 (patch)
treeec2b731c12b16589ccad98101de58594805006f2 /include
parent4d30eac3744d195ac43fbc36117d1e5de447b1ca (diff)
downloadlinux-5beaee54a324ba1fe307e341ec825d5d099f4091.tar.xz
mm: add is_huge_zero_folio()
This is the folio equivalent of is_huge_zero_page(). It doesn't add any efficiency, but it does prevent the caller from passing a tail page and getting confused when the predicate returns false. Link: https://lkml.kernel.org/r/20240326202833.523759-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/huge_mm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 1540a1481daf..600c6008262b 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -356,6 +356,11 @@ static inline bool is_huge_zero_page(const struct page *page)
return READ_ONCE(huge_zero_page) == page;
}
+static inline bool is_huge_zero_folio(const struct folio *folio)
+{
+ return READ_ONCE(huge_zero_page) == &folio->page;
+}
+
static inline bool is_huge_zero_pmd(pmd_t pmd)
{
return pmd_present(pmd) && READ_ONCE(huge_zero_pfn) == pmd_pfn(pmd);
@@ -485,6 +490,11 @@ static inline bool is_huge_zero_page(const struct page *page)
return false;
}
+static inline bool is_huge_zero_folio(const struct folio *folio)
+{
+ return false;
+}
+
static inline bool is_huge_zero_pmd(pmd_t pmd)
{
return false;