diff mbox series

[03/15] mm/z3fold: use zpdesc in z3fold_page_putback

Message ID 20240621054658.1220796-4-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>

Convert page to zpdesc in z3fold_page_putback function, and keep the
'page' parameter since the function hooks to page_putback, which is used
by other users.

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

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index b7f86c1b57a3..5cb156fc03be 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1350,8 +1350,9 @@  static void z3fold_page_putback(struct page *page)
 {
 	struct z3fold_header *zhdr;
 	struct z3fold_pool *pool;
+	struct zpdesc *zpdesc = page_zpdesc(page);
 
-	zhdr = page_address(page);
+	zhdr = zpdesc_address(zpdesc);
 	pool = zhdr_to_pool(zhdr);
 
 	z3fold_page_lock(zhdr);
@@ -1362,7 +1363,7 @@  static void z3fold_page_putback(struct page *page)
 		return;
 	if (list_empty(&zhdr->buddy))
 		add_to_unbuddied(pool, zhdr);
-	clear_bit(PAGE_CLAIMED, &page->private);
+	clear_bit(PAGE_CLAIMED, &zpdesc->zppage_flag);
 	z3fold_page_unlock(zhdr);
 }