diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-06-06 09:00:16 -0400 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-08-02 12:34:03 -0400 |
commit | 5490da4f06d182ba944706875029e98fe7f6b821 (patch) | |
tree | 4c42a8c208db20df8f41ae2155d146f796c63670 /mm/migrate.c | |
parent | 68f2736a858324c3ec852f6c2cddd9d1c777357d (diff) | |
download | linux-5490da4f06d182ba944706875029e98fe7f6b821.tar.gz linux-5490da4f06d182ba944706875029e98fe7f6b821.tar.bz2 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 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 11 |
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 |