diff mbox series

[08/15] mm/z3fold: use zpdesc free_pages_work

Message ID 20240621054658.1220796-9-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 main purpose is converting page->private to zpdesc->zppage_flag.

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

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index afdf21024f83..97580e2224c2 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -501,14 +501,14 @@  static void free_pages_work(struct work_struct *w)
 	while (!list_empty(&pool->stale)) {
 		struct z3fold_header *zhdr = list_first_entry(&pool->stale,
 						struct z3fold_header, buddy);
-		struct page *page = virt_to_page(zhdr);
+		struct zpdesc *zpdesc = page_zpdesc(virt_to_page(zhdr));
 
 		list_del(&zhdr->buddy);
-		if (WARN_ON(!test_bit(PAGE_STALE, &page->private)))
+		if (WARN_ON(!test_bit(PAGE_STALE, &zpdesc->zppage_flag)))
 			continue;
 		spin_unlock(&pool->stale_lock);
 		cancel_work_sync(&zhdr->work);
-		free_z3fold_page(page, false);
+		free_z3fold_page(zpdesc_page(zpdesc), false);
 		cond_resched();
 		spin_lock(&pool->stale_lock);
 	}