summaryrefslogtreecommitdiffstats
path: root/mm/folio-compat.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-05-07 21:26:29 +0200
committerMatthew Wilcox (Oracle) <willy@infradead.org>2021-10-18 13:49:39 +0200
commit19138349ed59b90ce58aca319b873eca2e04ad43 (patch)
treeb55487b03b82b5fb9e5837c4698ccfd17eda5857 /mm/folio-compat.c
parentmm/migrate: Add folio_migrate_mapping() (diff)
downloadlinux-19138349ed59b90ce58aca319b873eca2e04ad43.tar.xz
linux-19138349ed59b90ce58aca319b873eca2e04ad43.zip
mm/migrate: Add folio_migrate_flags()
Turn migrate_page_states() into a wrapper around folio_migrate_flags(). Also convert two functions only called from folio_migrate_flags() to be folio-based. ksm_migrate_page() becomes folio_migrate_ksm() and copy_page_owner() becomes folio_copy_owner(). folio_migrate_flags() alone shrinks by two thirds -- 1967 bytes down to 642 bytes. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Zi Yan <ziy@nvidia.com> Reviewed-by: David Howells <dhowells@redhat.com> Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/folio-compat.c')
-rw-r--r--mm/folio-compat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/folio-compat.c b/mm/folio-compat.c
index d883d964fd52..3f00ad92d1ff 100644
--- a/mm/folio-compat.c
+++ b/mm/folio-compat.c
@@ -58,4 +58,10 @@ int migrate_page_move_mapping(struct address_space *mapping,
page_folio(page), extra_count);
}
EXPORT_SYMBOL(migrate_page_move_mapping);
+
+void migrate_page_states(struct page *newpage, struct page *page)
+{
+ folio_migrate_flags(page_folio(newpage), page_folio(page));
+}
+EXPORT_SYMBOL(migrate_page_states);
#endif