summaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-06-06 15:00:16 +0200
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-08-02 18:34:03 +0200
commit5490da4f06d182ba944706875029e98fe7f6b821 (patch)
tree4c42a8c208db20df8f41ae2155d146f796c63670 /mm/migrate.c
parentmm: Convert all PageMovable users to movable_operations (diff)
downloadlinux-5490da4f06d182ba944706875029e98fe7f6b821.tar.xz
linux-5490da4f06d182ba944706875029e98fe7f6b821.zip
fs: Add aops->migrate_folio
Provide a folio-based replacement for aops->migratepage. Update the documentation to document migrate_folio instead of migratepage. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r--mm/migrate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 491f03747832..3c3c168097dd 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -856,14 +856,17 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
if (!mapping)
rc = migrate_page(mapping, &dst->page, &src->page, mode);
- else if (mapping->a_ops->migratepage)
+ else if (mapping->a_ops->migrate_folio)
/*
- * Most pages have a mapping and most filesystems
- * provide a migratepage callback. Anonymous pages
+ * Most folios have a mapping and most filesystems
+ * provide a migrate_folio callback. Anonymous folios
* are part of swap space which also has its own
- * migratepage callback. This is the most common path
+ * migrate_folio callback. This is the most common path
* for page migration.
*/
+ rc = mapping->a_ops->migrate_folio(mapping, dst, src,
+ mode);
+ else if (mapping->a_ops->migratepage)
rc = mapping->a_ops->migratepage(mapping, &dst->page,
&src->page, mode);
else