Skip to content

Commit

Permalink
fs: Remove aops->migratepage()
Browse files Browse the repository at this point in the history
With all users converted to migrate_folio(), remove this operation.

Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) committed Aug 2, 2022
1 parent 5409548 commit 9d0ddc0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ struct address_space_operations {
*/
int (*migrate_folio)(struct address_space *, struct folio *dst,
struct folio *src, enum migrate_mode);
int (*migratepage) (struct address_space *,
struct page *, struct page *, enum migrate_mode);
int (*launder_folio)(struct folio *);
bool (*is_partially_uptodate) (struct folio *, size_t from,
size_t count);
Expand Down
5 changes: 2 additions & 3 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,

/*
* Only pages without mappings or that have a
* ->migratepage callback are possible to migrate
* ->migrate_folio callback are possible to migrate
* without blocking. However, we can be racing with
* truncation so it's necessary to lock the page
* to stabilise the mapping as truncation holds
Expand All @@ -1043,8 +1043,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,

mapping = page_mapping(page);
migrate_dirty = !mapping ||
mapping->a_ops->migrate_folio ||
mapping->a_ops->migratepage;
mapping->a_ops->migrate_folio;
unlock_page(page);
if (!migrate_dirty)
goto isolate_fail_put;
Expand Down
3 changes: 0 additions & 3 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,9 +909,6 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
*/
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
rc = fallback_migrate_folio(mapping, dst, src, mode);
} else {
Expand Down

0 comments on commit 9d0ddc0

Please sign in to comment.