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

alexs
2024-06-21T05:42:25Z

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 --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