mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-12-19 17:16:06 +01:00
ubifs: Convert to filemap_migrate_folio()
filemap_migrate_folio() is a little more general than ubifs really needs, but it's better to share the code. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
parent
e7a60a1787
commit
e7b15bae55
|
|
@ -1461,29 +1461,6 @@ static bool ubifs_dirty_folio(struct address_space *mapping,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MIGRATION
|
|
||||||
static int ubifs_migrate_page(struct address_space *mapping,
|
|
||||||
struct page *newpage, struct page *page, enum migrate_mode mode)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = migrate_page_move_mapping(mapping, newpage, page, 0);
|
|
||||||
if (rc != MIGRATEPAGE_SUCCESS)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
if (PagePrivate(page)) {
|
|
||||||
detach_page_private(page);
|
|
||||||
attach_page_private(newpage, (void *)1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode != MIGRATE_SYNC_NO_COPY)
|
|
||||||
migrate_page_copy(newpage, page);
|
|
||||||
else
|
|
||||||
migrate_page_states(newpage, page);
|
|
||||||
return MIGRATEPAGE_SUCCESS;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool ubifs_release_folio(struct folio *folio, gfp_t unused_gfp_flags)
|
static bool ubifs_release_folio(struct folio *folio, gfp_t unused_gfp_flags)
|
||||||
{
|
{
|
||||||
struct inode *inode = folio->mapping->host;
|
struct inode *inode = folio->mapping->host;
|
||||||
|
|
@ -1649,9 +1626,7 @@ const struct address_space_operations ubifs_file_address_operations = {
|
||||||
.write_end = ubifs_write_end,
|
.write_end = ubifs_write_end,
|
||||||
.invalidate_folio = ubifs_invalidate_folio,
|
.invalidate_folio = ubifs_invalidate_folio,
|
||||||
.dirty_folio = ubifs_dirty_folio,
|
.dirty_folio = ubifs_dirty_folio,
|
||||||
#ifdef CONFIG_MIGRATION
|
.migrate_folio = filemap_migrate_folio,
|
||||||
.migratepage = ubifs_migrate_page,
|
|
||||||
#endif
|
|
||||||
.release_folio = ubifs_release_folio,
|
.release_folio = ubifs_release_folio,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user