* [PATCH] fs/dax: use page_ref_count() in dax_folio_put()
@ 2026-11-24 3:33 Nilay Vaish
0 siblings, 0 replies; only message in thread
From: Nilay Vaish @ 2026-11-24 3:33 UTC (permalink / raw)
To: Alistair Popple
Cc: Matthew Wilcox, Jan Kara, Christian Brauner, Alexander Viro,
linux-fsdevel, nvdimm, linux-kernel, Nilay Vaish
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-24 3:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 3:33 [PATCH] fs/dax: use page_ref_count() in dax_folio_put() Nilay Vaish
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®