From: Nilay Vaish <nilayvaish@google.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev,
linux-kernel@vger.kernel.org,
Nilay Vaish <nilayvaish@google.com>
Subject: [PATCH] fs/dax: use page_ref_count() in dax_folio_put()
Date: Mon, 23 Nov 2026 19:33:57 -0800 [thread overview]
Message-ID: <20261124033357.830767-1-nilayvaish@google.com> (raw)
Once dax_folio_reset_order() has turned a DAX folio back into single
pages, dax_folio_put() checks that none of them still holds a reference.
It does so by casting each struct page to struct folio and calling
folio_ref_count().
The cast relies on struct folio overlaying struct page. struct folio is
going to be allocated separately as part of the memdesc work, and casts
like this one have to go before that can happen.
page_ref_count() reads the same count from the page that the loop
already has, so use it.
No functional change.
Signed-off-by: Nilay Vaish <nilayvaish@google.com>
---
Notes:
This patch was written with the help of an AI coding assistant (Gemini).
Based on next-20261123.
fs/dax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index 9d161d7ef3ef..16cad82c689f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -449,7 +449,7 @@ static inline unsigned long dax_folio_put(struct folio *folio)
for (i = 0; i < (1UL << order); i++) {
struct page *page = folio_page(folio, i);
- WARN_ON_ONCE(folio_ref_count((struct folio *)page));
+ WARN_ON_ONCE(page_ref_count(page));
}
return ref;
base-commit: 3191063649dbf7c0d0b768e1f3655e4c5fc6edb5
--
2.56.1.839.g22a8290db9-goog
reply other threads:[~2026-11-24 3:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261124033357.830767-1-nilayvaish@google.com \
--to=nilayvaish@google.com \
--cc=apopple@nvidia.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=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
all inboxes | Powered by JetHome®