diff mbox series

[05/15] mm/z3fold: use zpdesc in init_z3fold_page

Message ID 20240621054658.1220796-6-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 func only uses page.private member, now use zpdesc.zppage_flag to
replace it.

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

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index bfbc9f9fdfd4..cd1332243c62 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -320,15 +320,16 @@  static inline void free_handle(unsigned long handle, struct z3fold_header *zhdr)
 static struct z3fold_header *init_z3fold_page(struct page *page, bool headless,
 					struct z3fold_pool *pool, gfp_t gfp)
 {
-	struct z3fold_header *zhdr = page_address(page);
+	struct zpdesc *zpdesc = page_zpdesc(page);
+	struct z3fold_header *zhdr = zpdesc_address(zpdesc);
 	struct z3fold_buddy_slots *slots;
 
-	clear_bit(PAGE_HEADLESS, &page->private);
-	clear_bit(MIDDLE_CHUNK_MAPPED, &page->private);
-	clear_bit(NEEDS_COMPACTING, &page->private);
-	clear_bit(PAGE_STALE, &page->private);
-	clear_bit(PAGE_CLAIMED, &page->private);
-	clear_bit(PAGE_MIGRATED, &page->private);
+	clear_bit(PAGE_HEADLESS, &zpdesc->zppage_flag);
+	clear_bit(MIDDLE_CHUNK_MAPPED, &zpdesc->zppage_flag);
+	clear_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag);
+	clear_bit(PAGE_STALE, &zpdesc->zppage_flag);
+	clear_bit(PAGE_CLAIMED, &zpdesc->zppage_flag);
+	clear_bit(PAGE_MIGRATED, &zpdesc->zppage_flag);
 	if (headless)
 		return zhdr;