diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-05-07 21:05:06 +0200 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-10-18 13:49:39 +0200 |
commit | 715cbfd6c5c595bc8b7a6f9ad1fe9fec0122bb20 (patch) | |
tree | 029dfa5ed425a0a06fc6c00885c68f3eeaaf2b5e /mm/migrate.c | |
parent | mm/migrate: Add folio_migrate_flags() (diff) | |
download | linux-715cbfd6c5c595bc8b7a6f9ad1fe9fec0122bb20.tar.xz linux-715cbfd6c5c595bc8b7a6f9ad1fe9fec0122bb20.zip |
mm/migrate: Add folio_migrate_copy()
This is the folio equivalent of migrate_page_copy(), which is retained
as a wrapper for filesystems which are not yet converted to folios.
Also convert copy_huge_page() to folio_copy().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index f6e0017ef0bf..433c453b47f9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -614,16 +614,12 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) } EXPORT_SYMBOL(folio_migrate_flags); -void migrate_page_copy(struct page *newpage, struct page *page) +void folio_migrate_copy(struct folio *newfolio, struct folio *folio) { - if (PageHuge(page) || PageTransHuge(page)) - copy_huge_page(newpage, page); - else - copy_highpage(newpage, page); - - migrate_page_states(newpage, page); + folio_copy(newfolio, folio); + folio_migrate_flags(newfolio, folio); } -EXPORT_SYMBOL(migrate_page_copy); +EXPORT_SYMBOL(folio_migrate_copy); /************************************************************ * Migration functions @@ -651,7 +647,7 @@ int migrate_page(struct address_space *mapping, return rc; if (mode != MIGRATE_SYNC_NO_COPY) - migrate_page_copy(newpage, page); + folio_migrate_copy(newfolio, folio); else folio_migrate_flags(newfolio, folio); return MIGRATEPAGE_SUCCESS; |