[PATCH 04/15] mm/z3fold: use zpdesc in get/put_z3fold_header funcs
From: alexs
Date: Fri Jun 21 2024 - 01:42:56 EST
From: Alex Shi <alexs@xxxxxxxxxx>
Convert the get/put_z3fold_header funcs pair to use zpdesc.
Signed-off-by: Alex Shi <alexs@xxxxxxxxxx>
---
mm/z3fold.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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);
}
--
2.43.0