diff mbox series

[15/15] mm/z3fold: introduce __zpdesc_clear_movable

Message ID 20240621054658.1220796-16-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>

Add a helper __zpdesc_clear_movable() for __ClearPageMovable(), and use it
in callers, that make code clear.

Signed-off-by: Alex Shi <alexs@kernel.org>
---
 mm/z3fold.c | 4 ++--
 mm/zpdesc.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 35e48440c517..e23d56f46760 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -352,7 +352,7 @@  static void free_z3fold_page(struct zpdesc *zpdesc, bool headless)
 {
 	if (!headless) {
 		zpdesc_lock(zpdesc);
-		__ClearPageMovable(zpdesc_page(zpdesc));
+		__zpdesc_clear_movable(zpdesc);
 		zpdesc_unlock(zpdesc);
 	}
 	__free_page(zpdesc_page(zpdesc));
@@ -1322,7 +1322,7 @@  static int z3fold_page_migrate(struct page *newpage, struct page *page,
 	 * so we only have to reinitialize it.
 	 */
 	INIT_LIST_HEAD(&new_zhdr->buddy);
-	__ClearPageMovable(zpdesc_page(zpdesc));
+	__zpdesc_clear_movable(zpdesc);
 
 	zpdesc_get(newzpdesc);
 	z3fold_page_lock(new_zhdr);
diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index 44473382f2cc..1319575dc31a 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -79,4 +79,9 @@  static inline void __zpdesc_set_movable(struct zpdesc *zpdesc,
 	__SetPageMovable(zpdesc_page(zpdesc), mops);
 }
 
+static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc)
+{
+	__ClearPageMovable(zpdesc_page(zpdesc));
+}
+
 #endif