]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
hugetlb: Remove uses of compound_dtor and compound_nr
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 5 Sep 2022 00:02:59 +0000 (20:02 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 3 Jan 2023 04:00:56 +0000 (23:00 -0500)
Convert the entire file to use the folio equivalents.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/hugetlb.c

index 0a6bb471c1a747a3f747b251b8383a0613cae136..72f21bdc581e0505c73cf3f1f3b06b936856f1c5 100644 (file)
@@ -2042,11 +2042,12 @@ static bool prep_compound_gigantic_folio_for_demote(struct folio *folio,
  */
 int PageHuge(struct page *page)
 {
+       struct folio *folio;
+
        if (!PageCompound(page))
                return 0;
-
-       page = compound_head(page);
-       return page[1].compound_dtor == HUGETLB_PAGE_DTOR;
+       folio = page_folio(page);
+       return folio->_folio_dtor == HUGETLB_PAGE_DTOR;
 }
 EXPORT_SYMBOL_GPL(PageHuge);
 
@@ -2056,10 +2057,11 @@ EXPORT_SYMBOL_GPL(PageHuge);
  */
 int PageHeadHuge(struct page *page_head)
 {
-       if (!PageHead(page_head))
+       struct folio *folio = (struct folio *)page_head;
+       if (!folio_test_large(folio))
                return 0;
 
-       return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
+       return folio->_folio_dtor == HUGETLB_PAGE_DTOR;
 }
 EXPORT_SYMBOL_GPL(PageHeadHuge);