Skip to contentSkip to conversation

mm: Export PageHeadHuge()

PATCH Applied David Howells 2 participants 2 messages Feb 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Export PageHeadHuge()

Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by such as folio_file_page() and folio_contains(). Matthew suggested I use the first of those instead of doing the same calculation manually - but I can't call it from a module.

Kirill suggested rearranging things to put it in a header, but that introduces header dependencies because of where constants are defined.

---
 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)
mm/hugetlb.c +1 -0
index 61895cc01d09..5768df43b05c 100644
@@ -1854,6 +1854,7 @@ int PageHeadHuge(struct page *page_head)
 
 	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
 }
+EXPORT_SYMBOL(PageHeadHuge);
 
 /*
  * Find and lock address space (mapping) in write mode.
#1 lore raw
Quoted 22 lines · David Howells

Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by such as folio_file_page() and folio_contains(). Matthew suggested I use the first of those instead of doing the same calculation manually - but I can't call it from a module.

Kirill suggested rearranging things to put it in a header, but that introduces header dependencies because of where constants are defined.

---
 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)
mm/hugetlb.c +0 -0
index 61895cc01d09..5768df43b05c 100644

mm/hugetlb.c int PageHeadHuge(struct page *page_head) · line 1857

Quoted 4 lines
mm/hugetlb.c +1 -0
@@ -1854,6 +1854,7 @@ int PageHeadHuge(struct page *page_head)
 
 	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
 }
+EXPORT_SYMBOL(PageHeadHuge);

EXPORT_SYMBOL_GPL for anything hugepage related, please.