mm: remove set_compound_page_dtor()
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Mon, 12 Jun 2023 16:34:05 +0000 (09:34 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 19 Jun 2023 23:19:19 +0000 (16:19 -0700)
All users can use the folio equivalent so this function can be safely
removed.

Link: https://lkml.kernel.org/r/20230612163405.99345-1-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Tarun Sahu <tsahu@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h
mm/huge_memory.c
mm/internal.h

index a08dc8cc48fb50a0378698f777fcf8f8c5d9cb7d..8f40bf17d5973a94d3da08b0b6d21c6c81db227c 100644 (file)
@@ -1223,16 +1223,6 @@ enum compound_dtor_id {
 };
 extern compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS];
 
-static inline void set_compound_page_dtor(struct page *page,
-               enum compound_dtor_id compound_dtor)
-{
-       struct folio *folio = (struct folio *)page;
-
-       VM_BUG_ON_PAGE(compound_dtor >= NR_COMPOUND_DTORS, page);
-       VM_BUG_ON_PAGE(!PageHead(page), page);
-       folio->_folio_dtor = compound_dtor;
-}
-
 static inline void folio_set_compound_dtor(struct folio *folio,
                enum compound_dtor_id compound_dtor)
 {
index 31bc8fa768e3d3c7cc56c0385740458fdc1530ab..76f970aa5b4da3a7356ace072c48ab9d6dedbae7 100644 (file)
@@ -583,7 +583,7 @@ void prep_transhuge_page(struct page *page)
 
        VM_BUG_ON_FOLIO(folio_order(folio) < 2, folio);
        INIT_LIST_HEAD(&folio->_deferred_list);
-       set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
+       folio_set_compound_dtor(folio, TRANSHUGE_PAGE_DTOR);
 }
 
 static inline bool is_transparent_hugepage(struct page *page)
index faf0508d89a5daca523cc24b4a6683ed4f45cd2d..33b8b8f66af33eff6feab2984f7b0d431007e92b 100644 (file)
@@ -391,7 +391,7 @@ static inline void prep_compound_head(struct page *page, unsigned int order)
 {
        struct folio *folio = (struct folio *)page;
 
-       set_compound_page_dtor(page, COMPOUND_PAGE_DTOR);
+       folio_set_compound_dtor(folio, COMPOUND_PAGE_DTOR);
        set_compound_order(page, order);
        atomic_set(&folio->_entire_mapcount, -1);
        atomic_set(&folio->_nr_pages_mapped, 0);