diff mbox series

mm: Export PageHeadHuge()

Message ID 2494562.1646054576@warthog.procyon.org.uk (mailing list archive)
State New
Headers show
Series mm: Export PageHeadHuge() | expand

Commit Message

David Howells Feb. 28, 2022, 1:22 p.m. UTC
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.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: willy@infradead.org
Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/

---
 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Christoph Hellwig Feb. 28, 2022, 1:41 p.m. UTC | #1
On Mon, Feb 28, 2022 at 01:22:56PM +0000, David Howells wrote:
>     
> 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.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: willy@infradead.org
> Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/
> 
> ---
>  mm/hugetlb.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 61895cc01d09..5768df43b05c 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -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.
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 61895cc01d09..5768df43b05c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -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.