diff mbox series

[v9,mm-unstable,19/19] mm/zsmalloc: reset zpdesc fields in reset_zpdesc()

Message ID Z4Uw136VdG7vlKCL@localhost.localdomain (mailing list archive)
State New
Headers show
Series Add zpdesc memory descriptor for zswap.zpool | expand

Commit Message

Hyeonggon Yoo Jan. 13, 2025, 3:29 p.m. UTC
To prepare for the future removal of struct page fields (e.g. the removal
of page->index [1]), update reset_zpdesc() to reset the descriptor
via struct zpdesc instead of struct page.

As struct zpdesc overlays struct page for now,
no functional change is intended.

[1] https://lore.kernel.org/linux-mm/Z09hOy-UY9KC8WMb@casper.infradead.org

Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
---
 mm/zsmalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index dae32e051779..817626a351f8 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -826,8 +826,8 @@  static void reset_zpdesc(struct zpdesc *zpdesc)
 
 	__ClearPageMovable(page);
 	ClearPagePrivate(page);
-	set_page_private(page, 0);
-	page->index = 0;
+	zpdesc->zspage = NULL;
+	zpdesc->next = NULL;
 	__ClearPageZsmalloc(page);
 }