[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240621054658.1220796-16-alexs@kernel.org>
Date: Fri, 21 Jun 2024 13:46:55 +0800
From: alexs@...nel.org
To: Vitaly Wool <vitaly.wool@...sulko.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
minchan@...nel.org,
willy@...radead.org,
senozhatsky@...omium.org,
david@...hat.com,
42.hyeyoo@...il.com
Cc: Alex Shi <alexs@...nel.org>
Subject: [PATCH 15/15] mm/z3fold: introduce __zpdesc_clear_movable
From: Alex Shi <alexs@...nel.org>
Add a helper __zpdesc_clear_movable() for __ClearPageMovable(), and use it
in callers, that make code clear.
Signed-off-by: Alex Shi <alexs@...nel.org>
---
mm/z3fold.c | 4 ++--
mm/zpdesc.h | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
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
--
2.43.0
Powered by blists - more mailing lists