File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -815,14 +815,9 @@ static inline void ClearPageCompound(struct page *page)
815815
816816#ifdef CONFIG_HUGETLB_PAGE
817817int PageHuge (struct page * page );
818- int PageHeadHuge (struct page * page );
819- static inline bool folio_test_hugetlb (struct folio * folio )
820- {
821- return PageHeadHuge (& folio -> page );
822- }
818+ bool folio_test_hugetlb (struct folio * folio );
823819#else
824820TESTPAGEFLAG_FALSE (Huge , hugetlb )
825- TESTPAGEFLAG_FALSE (HeadHuge , headhuge )
826821#endif
827822
828823#ifdef CONFIG_TRANSPARENT_HUGEPAGE
Original file line number Diff line number Diff line change @@ -2050,19 +2050,23 @@ int PageHuge(struct page *page)
20502050}
20512051EXPORT_SYMBOL_GPL (PageHuge );
20522052
2053- /*
2054- * PageHeadHuge() only returns true for hugetlbfs head page, but not for
2055- * normal or transparent huge pages.
2053+ /**
2054+ * folio_test_hugetlb - Determine if the folio belongs to hugetlbfs
2055+ * @folio: The folio to test.
2056+ *
2057+ * Context: Any context. Caller should have a reference on the folio to
2058+ * prevent it from being turned into a tail page.
2059+ * Return: True for hugetlbfs folios, false for anon folios or folios
2060+ * belonging to other filesystems.
20562061 */
2057- int PageHeadHuge (struct page * page_head )
2062+ bool folio_test_hugetlb (struct folio * folio )
20582063{
2059- struct folio * folio = (struct folio * )page_head ;
20602064 if (!folio_test_large (folio ))
2061- return 0 ;
2065+ return false ;
20622066
20632067 return folio -> _folio_dtor == HUGETLB_PAGE_DTOR ;
20642068}
2065- EXPORT_SYMBOL_GPL (PageHeadHuge );
2069+ EXPORT_SYMBOL_GPL (folio_test_hugetlb );
20662070
20672071/*
20682072 * Find and lock address space (mapping) in write mode.
You can’t perform that action at this time.
0 commit comments