Skip to contentSkip to conversation

erofs: use page_private() in z_erofs_is_shortlived_page()

PATCH New Nilay Vaish 1 participant 1 message Nov 24 EROFS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erofs: use page_private() in z_erofs_is_shortlived_page()

Short-lived pages are marked with set_page_private(), but z_erofs_is_shortlived_page() tests the marker by reading page->private directly.

struct page is being shrunk as part of the memdesc work, and its private field is one of those that will move. Direct users have to go through the accessors before that can happen.

Read the marker with page_private(), to match how it is set.

No functional change.

---

Notes:
This patch was written with the help of an AI coding assistant (Gemini).

Based on next-20261123.

 fs/erofs/compress.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/compress.h +1 -1
index 84c8e52581f4..a9ff02b443a8 100644
@@ -41,7 +41,7 @@ struct z_erofs_decompressor {
  */
 static inline bool z_erofs_is_shortlived_page(struct page *page)
 {
-	return page->private == Z_EROFS_SHORTLIVED_PAGE;
+	return page_private(page) == Z_EROFS_SHORTLIVED_PAGE;
 }
 
 static inline bool z_erofs_put_shortlivedpage(struct page **pagepool,

base-commit: 3191063649dbf7c0d0b768e1f3655e4c5fc6edb5
prerequisite-patch-id: d52d42a2ec9ddc2b12b3412ec0d07254b417e60f
prerequisite-patch-id: d8338f943ba7ae297eefbb26dabc3bcfe7994461

Signature · 1 line
2.56.1.839.g22a8290db9-goog