diff mbox series

[04/15] mm/z3fold: use zpdesc in get/put_z3fold_header funcs

Message ID 20240621054658.1220796-5-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 the get/put_z3fold_header funcs pair to use zpdesc.

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

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 5cb156fc03be..bfbc9f9fdfd4 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -254,9 +254,9 @@  static inline struct z3fold_header *get_z3fold_header(unsigned long handle)
 			locked = z3fold_page_trylock(zhdr);
 			read_unlock(&slots->lock);
 			if (locked) {
-				struct page *page = virt_to_page(zhdr);
+				struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr));
 
-				if (!test_bit(PAGE_MIGRATED, &page->private))
+				if (!test_bit(PAGE_MIGRATED, &zpdesc->zppage_flag))
 					break;
 				z3fold_page_unlock(zhdr);
 			}
@@ -271,9 +271,9 @@  static inline struct z3fold_header *get_z3fold_header(unsigned long handle)
 
 static inline void put_z3fold_header(struct z3fold_header *zhdr)
 {
-	struct page *page = virt_to_page(zhdr);
+	struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr));
 
-	if (!test_bit(PAGE_HEADLESS, &page->private))
+	if (!test_bit(PAGE_HEADLESS, &zpdesc->zppage_flag))
 		z3fold_page_unlock(zhdr);
 }