From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH 5/6] ceph: Remove call to PagePrivate2()
Date: Wed, 2 Oct 2024 05:01:07 +0100 [thread overview]
Message-ID: <20241002040111.1023018-6-willy@infradead.org> (raw)
In-Reply-To: <20241002040111.1023018-1-willy@infradead.org>
Use the folio that we already have to call folio_test_private_2()
instead. This is the last call to PagePrivate2(), so replace its
PAGEFLAG() definition with FOLIO_FLAG().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/ceph/addr.c | 20 ++++++++++----------
include/linux/page-flags.h | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 53fef258c2bc..a8788e300dc7 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1051,7 +1051,9 @@ static int ceph_writepages_start(struct address_space *mapping,
if (!nr_folios && !locked_pages)
break;
for (i = 0; i < nr_folios && locked_pages < max_pages; i++) {
- page = &fbatch.folios[i]->page;
+ struct folio *folio = fbatch.folios[i];
+
+ page = &folio->page;
doutc(cl, "? %p idx %lu\n", page, page->index);
if (locked_pages == 0)
lock_page(page); /* first page */
@@ -1078,8 +1080,6 @@ static int ceph_writepages_start(struct address_space *mapping,
continue;
}
if (page_offset(page) >= ceph_wbc.i_size) {
- struct folio *folio = page_folio(page);
-
doutc(cl, "folio at %lu beyond eof %llu\n",
folio->index, ceph_wbc.i_size);
if ((ceph_wbc.size_stable ||
@@ -1095,16 +1095,16 @@ static int ceph_writepages_start(struct address_space *mapping,
unlock_page(page);
break;
}
- if (PageWriteback(page) ||
- PagePrivate2(page) /* [DEPRECATED] */) {
+ if (folio_test_writeback(folio) ||
+ folio_test_private_2(folio) /* [DEPRECATED] */) {
if (wbc->sync_mode == WB_SYNC_NONE) {
- doutc(cl, "%p under writeback\n", page);
- unlock_page(page);
+ doutc(cl, "%p under writeback\n", folio);
+ folio_unlock(folio);
continue;
}
- doutc(cl, "waiting on writeback %p\n", page);
- wait_on_page_writeback(page);
- folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */
+ doutc(cl, "waiting on writeback %p\n", folio);
+ folio_wait_writeback(folio);
+ folio_wait_private_2(folio); /* [DEPRECATED] */
}
if (!clear_page_dirty_for_io(page)) {
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 35d08c30d4a6..4c2dfe289046 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -543,7 +543,7 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE)
* - PG_private and PG_private_2 cause release_folio() and co to be invoked
*/
PAGEFLAG(Private, private, PF_ANY)
-PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY)
+FOLIO_FLAG(private_2, FOLIO_HEAD_PAGE)
/* owner_2 can be set on tail pages for anon memory */
FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE)
--
2.43.0
next prev parent reply other threads:[~2024-10-02 4:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 4:01 [PATCH 0/6] Filesystem page flags cleanup Matthew Wilcox (Oracle)
2024-10-02 4:01 ` [PATCH 1/6] fs: Move clearing of mappedtodisk to buffer.c Matthew Wilcox (Oracle)
2024-10-03 12:10 ` Jan Kara
2024-10-03 14:19 ` Matthew Wilcox
2024-10-02 4:01 ` [PATCH 2/6] nilfs2: Convert nilfs_copy_buffer() to use folios Matthew Wilcox (Oracle)
2024-10-02 13:11 ` Ryusuke Konishi
2024-10-02 4:01 ` [PATCH 3/6] mm: Remove PageMappedToDisk Matthew Wilcox (Oracle)
2024-10-03 12:11 ` Jan Kara
2024-10-02 4:01 ` [PATCH 4/6] btrfs: Switch from using the private_2 flag to owner_2 Matthew Wilcox (Oracle)
2024-10-03 17:09 ` Josef Bacik
2024-10-02 4:01 ` Matthew Wilcox (Oracle) [this message]
2024-10-02 4:01 ` [PATCH 6/6] migrate: Remove references to Private2 Matthew Wilcox (Oracle)
2024-10-03 12:13 ` Jan Kara
2024-10-04 7:24 ` [PATCH 0/6] Filesystem page flags cleanup Christian Brauner
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=20241002040111.1023018-6-willy@infradead.org \
--to=willy@infradead.org \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nilfs@vger.kernel.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).