nfs: Convert to migrate_folio
[linux-block.git] / fs / nfs / write.c
index 1c706465d090b095b98c900d8b5fe7cb407af57e..649b9e63345974ec02b1683a5c9c764512a7c3ba 100644 (file)
@@ -2119,27 +2119,27 @@ out_error:
 }
 
 #ifdef CONFIG_MIGRATION
-int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
-               struct page *page, enum migrate_mode mode)
+int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
+               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.
         *
         * 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
-        *        the page lock.
+        *        the folio lock.
         */
-       if (PagePrivate(page))
+       if (folio_test_private(src))
                return -EBUSY;
 
-       if (PageFsCache(page)) {
+       if (folio_test_fscache(src)) {
                if (mode == MIGRATE_ASYNC)
                        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