Replace the last user of PageTransCompound() by PageCompound in ksm, and get rid of PageTransCompound(). Signed-off-by: Kefeng Wang --- include/linux/page-flags.h | 14 -------------- mm/ksm.c | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 7223f6f4e2b4..7a863572adce 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -879,20 +879,6 @@ FOLIO_FLAG_FALSE(partially_mapped) #define PG_head_mask ((1UL << PG_head)) -#ifdef CONFIG_TRANSPARENT_HUGEPAGE -/* - * PageTransCompound returns true for both transparent huge pages - * and hugetlbfs pages, so it should only be called when it's known - * that hugetlbfs pages aren't involved. - */ -static inline int PageTransCompound(const struct page *page) -{ - return PageCompound(page); -} -#else -TESTPAGEFLAG_FALSE(TransCompound, transcompound) -#endif - #if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_TRANSPARENT_HUGEPAGE) /* * PageHasHWPoisoned indicates that at least one subpage is hwpoisoned in the diff --git a/mm/ksm.c b/mm/ksm.c index 7d5b76478f0b..75db9ecebdc9 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2341,7 +2341,7 @@ static void cmp_and_merge_page(struct page *page, struct ksm_rmap_item *rmap_ite * afterwards, the reference count will be correct and * split_huge_page should succeed. */ - split = PageTransCompound(page) + split = PageCompound(page) && compound_head(page) == compound_head(tree_page); put_page(tree_page); if (kfolio) { -- 2.27.0