From: Matthew Wilcox (Oracle) <willy@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH v2 04/19] mm/migrate: Convert fallback_migrate_page() to fallback_migrate_folio()
Date: Wed, 8 Jun 2022 16:02:34 +0100 [thread overview]
Message-ID: <20220608150249.3033815-5-willy@infradead.org> (raw)
In-Reply-To: <20220608150249.3033815-1-willy@infradead.org>
Use a folio throughout. migrate_page() will be converted to
migrate_folio() later.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
mm/migrate.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index e064b998ead0..1878de817a01 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -805,11 +805,11 @@ static int writeout(struct address_space *mapping, struct page *page)
/*
* Default handling if a filesystem does not provide a migration function.
*/
-static int fallback_migrate_page(struct address_space *mapping,
- struct page *newpage, struct page *page, enum migrate_mode mode)
+static int fallback_migrate_folio(struct address_space *mapping,
+ struct folio *dst, struct folio *src, enum migrate_mode mode)
{
- if (PageDirty(page)) {
- /* Only writeback pages in full synchronous migration */
+ if (folio_test_dirty(src)) {
+ /* Only writeback folios in full synchronous migration */
switch (mode) {
case MIGRATE_SYNC:
case MIGRATE_SYNC_NO_COPY:
@@ -817,18 +817,18 @@ static int fallback_migrate_page(struct address_space *mapping,
default:
return -EBUSY;
}
- return writeout(mapping, page);
+ return writeout(mapping, &src->page);
}
/*
* Buffers may be managed in a filesystem specific way.
* We must have no buffers or drop them.
*/
- if (page_has_private(page) &&
- !try_to_release_page(page, GFP_KERNEL))
+ if (folio_test_private(src) &&
+ !filemap_release_folio(src, GFP_KERNEL))
return mode == MIGRATE_SYNC ? -EAGAIN : -EBUSY;
- return migrate_page(mapping, newpage, page, mode);
+ return migrate_page(mapping, &dst->page, &src->page, mode);
}
/*
@@ -870,8 +870,7 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
rc = mapping->a_ops->migratepage(mapping, &dst->page,
&src->page, mode);
else
- rc = fallback_migrate_page(mapping, &dst->page,
- &src->page, mode);
+ rc = fallback_migrate_folio(mapping, dst, src, mode);
} else {
const struct movable_operations *mops;
--
2.35.1
next prev parent reply other threads:[~2022-06-08 15:02 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 15:02 [Cluster-devel] [PATCH v2 00/19] Convert aops->migratepage to aops->migrate_folio Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 01/19] secretmem: Remove isolate_page Matthew Wilcox
2022-06-09 12:46 ` David Hildenbrand
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 02/19] mm: Convert all PageMovable users to movable_operations Matthew Wilcox
2022-06-09 10:23 ` David Hildenbrand
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 03/19] fs: Add aops->migrate_folio Matthew Wilcox
2022-06-09 12:50 ` David Hildenbrand
2022-06-09 14:35 ` Matthew Wilcox
2022-06-10 10:17 ` David Hildenbrand
2022-06-08 15:02 ` Matthew Wilcox [this message]
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 05/19] mm/migrate: Convert writeout() to take a folio Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 06/19] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio() Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 07/19] mm/migrate: Convert expected_page_refs() to folio_expected_refs() Matthew Wilcox
2022-07-08 2:50 ` Hugh Dickins
2022-07-08 3:29 ` Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 08/19] btrfs: Convert btree_migratepage to migrate_folio Matthew Wilcox
2022-06-09 16:25 ` David Sterba
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 09/19] nfs: Convert " Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 10/19] mm/migrate: Convert migrate_page() to migrate_folio() Matthew Wilcox
2022-06-09 16:26 ` David Sterba
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 11/19] mm/migrate: Add filemap_migrate_folio() Matthew Wilcox
2022-06-08 15:22 ` Darrick J. Wong
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 12/19] btrfs: Convert btrfs_migratepage to migrate_folio Matthew Wilcox
2022-06-09 16:33 ` David Sterba
2022-06-09 17:40 ` Matthew Wilcox
2022-06-09 23:05 ` David Sterba
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 13/19] ubifs: Convert to filemap_migrate_folio() Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 14/19] f2fs: " Matthew Wilcox
2022-06-15 8:11 ` [Cluster-devel] [f2fs-dev] " Chao Yu
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 15/19] aio: Convert to migrate_folio Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 16/19] hugetlb: " Matthew Wilcox
2022-06-09 3:53 ` Muchun Song
2022-06-09 20:51 ` Mike Kravetz
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 17/19] secretmem: " Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 18/19] fs: Remove aops->migratepage() Matthew Wilcox
2022-06-08 15:02 ` [Cluster-devel] [PATCH v2 19/19] mm/folio-compat: Remove migration compatibility functions Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220608150249.3033815-5-willy@infradead.org \
--to=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).