nfs: Convert to migrate_folio

Use a folio throughout this function.  migrate_page() will be converted
later.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 8958b551
...@@ -533,9 +533,7 @@ const struct address_space_operations nfs_file_aops = { ...@@ -533,9 +533,7 @@ const struct address_space_operations nfs_file_aops = {
.write_end = nfs_write_end, .write_end = nfs_write_end,
.invalidate_folio = nfs_invalidate_folio, .invalidate_folio = nfs_invalidate_folio,
.release_folio = nfs_release_folio, .release_folio = nfs_release_folio,
#ifdef CONFIG_MIGRATION .migrate_folio = nfs_migrate_folio,
.migratepage = nfs_migrate_page,
#endif
.launder_folio = nfs_launder_folio, .launder_folio = nfs_launder_folio,
.is_dirty_writeback = nfs_check_dirty_writeback, .is_dirty_writeback = nfs_check_dirty_writeback,
.error_remove_page = generic_error_remove_page, .error_remove_page = generic_error_remove_page,
......
...@@ -578,8 +578,10 @@ void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo) ...@@ -578,8 +578,10 @@ void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo)
#endif #endif
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
extern int nfs_migrate_page(struct address_space *, int nfs_migrate_folio(struct address_space *, struct folio *dst,
struct page *, struct page *, enum migrate_mode); struct folio *src, enum migrate_mode);
#else
#define nfs_migrate_folio NULL
#endif #endif
static inline int static inline int
......
...@@ -2119,27 +2119,27 @@ int nfs_wb_page(struct inode *inode, struct page *page) ...@@ -2119,27 +2119,27 @@ int nfs_wb_page(struct inode *inode, struct page *page)
} }
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
int nfs_migrate_page(struct address_space *mapping, struct page *newpage, int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
struct page *page, enum migrate_mode mode) struct folio *src, enum migrate_mode mode)
{ {
/* /*
* If PagePrivate is set, then the page is currently associated with * If the private flag is set, the folio is currently associated with
* an in-progress read or write request. Don't try to migrate it. * an in-progress read or write request. Don't try to migrate it.
* *
* FIXME: we could do this in principle, but we'll need a way to ensure * FIXME: we could do this in principle, but we'll need a way to ensure
* that we can safely release the inode reference while holding * that we can safely release the inode reference while holding
* the page lock. * the folio lock.
*/ */
if (PagePrivate(page)) if (folio_test_private(src))
return -EBUSY; return -EBUSY;
if (PageFsCache(page)) { if (folio_test_fscache(src)) {
if (mode == MIGRATE_ASYNC) if (mode == MIGRATE_ASYNC)
return -EBUSY; return -EBUSY;
wait_on_page_fscache(page); folio_wait_fscache(src);
} }
return migrate_page(mapping, newpage, page, mode); return migrate_page(mapping, &dst->page, &src->page, mode);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment