lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 28 Feb 2024 10:40:31 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Minchan Kim <minchan@...nel.org>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Chengming Zhou <zhouchengming@...edance.com>
Cc: Arnd Bergmann <arnd@...db.de>,
	Nhat Pham <nphamcs@...il.com>,
	Domenico Cerasuolo <cerasuolodomenico@...il.com>,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] mm/zsmalloc: move get_zspage_lockless into #ifdef

From: Arnd Bergmann <arnd@...db.de>

It's only used from inside of an #ifdef section, causing a warning otherwise:

mm/zsmalloc.c:735:23: error: unused function 'get_zspage_lockless' [-Werror,-Wunused-function]
  735 | static struct zspage *get_zspage_lockless(struct page *page)
      |                       ^~~~~~~~~~~~~~~~~~~

Move it down into that block to avoid adding another #ifdef.

Fixes: 2258bdebb55e ("mm/zsmalloc: don't hold locks of all pages when free_zspage()")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 mm/zsmalloc.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 1a044690b389..11422305d819 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -731,14 +731,6 @@ static struct zspage *get_zspage(struct page *page)
 	return zspage;
 }
 
-/* Only used in zs_page_migrate() to get zspage locklessly. */
-static struct zspage *get_zspage_lockless(struct page *page)
-{
-	struct zspage __rcu **private = (struct zspage __rcu **)&page->private;
-
-	return rcu_dereference(*private);
-}
-
 static struct page *get_next_page(struct page *page)
 {
 	struct zspage *zspage = get_zspage(page);
@@ -1651,6 +1643,13 @@ static void migrate_write_unlock(struct zspage *zspage)
 }
 
 #ifdef CONFIG_COMPACTION
+/* Only used in zs_page_migrate() to get zspage locklessly. */
+static struct zspage *get_zspage_lockless(struct page *page)
+{
+	struct zspage __rcu **private = (struct zspage __rcu **)&page->private;
+
+	return rcu_dereference(*private);
+}
 
 static const struct movable_operations zsmalloc_mops;
 
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ