diff mbox series

[07/15] mm/z3fold: convert page to zpdesc in __release_z3fold_page

Message ID 20240621054658.1220796-8-alexs@kernel.org (mailing list archive)
State New
Headers show
Series add zpdesc memory descriptor for zswap.zpool | expand

Commit Message

alexs@kernel.org June 21, 2024, 5:46 a.m. UTC
From: Alex Shi <alexs@kernel.org>

The main purpose is converting page->private to zpdesc->zppage_flag.

Signed-off-by: Alex Shi <alexs@kernel.org>
---
 mm/z3fold.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index c3c740b42052..afdf21024f83 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -441,12 +441,12 @@  static inline struct z3fold_pool *zhdr_to_pool(struct z3fold_header *zhdr)
 
 static void __release_z3fold_page(struct z3fold_header *zhdr, bool locked)
 {
-	struct page *page = virt_to_page(zhdr);
+	struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr));
 	struct z3fold_pool *pool = zhdr_to_pool(zhdr);
 
 	WARN_ON(!list_empty(&zhdr->buddy));
-	set_bit(PAGE_STALE, &page->private);
-	clear_bit(NEEDS_COMPACTING, &page->private);
+	set_bit(PAGE_STALE, &zpdesc->zppage_flag);
+	clear_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag);
 	spin_lock(&pool->lock);
 	spin_unlock(&pool->lock);