mm: convert is_transparent_hugepage() to use a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 11 Jan 2023 14:29:05 +0000 (14:29 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:32:58 +0000 (22:32 -0800)
Replace a use of page->compound_dtor with its folio equivalent.

Link: https://lkml.kernel.org/r/20230111142915.1001531-20-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index 9570f03..bfa960f 100644 (file)
@@ -591,12 +591,14 @@ void prep_transhuge_page(struct page *page)
 
 static inline bool is_transparent_hugepage(struct page *page)
 {
+       struct folio *folio;
+
        if (!PageCompound(page))
                return false;
 
-       page = compound_head(page);
-       return is_huge_zero_page(page) ||
-              page[1].compound_dtor == TRANSHUGE_PAGE_DTOR;
+       folio = page_folio(page);
+       return is_huge_zero_page(&folio->page) ||
+              folio->_folio_dtor == TRANSHUGE_PAGE_DTOR;
 }
 
 static unsigned long __thp_get_unmapped_area(struct file *filp,