File 0043-LU-15420-libcfs-replace-deprecated-CPU-hotplug-funct.patch of Package lustre_2_12

From e5c9e8af58928ba7c4f288d49dbab596deec243f Mon Sep 17 00:00:00 2001
From: Jian Yu <yujian@whamcloud.com>
Date: Wed, 12 Jan 2022 17:04:12 -0800
Subject: [PATCH] LU-15420 libcfs: replace deprecated CPU-hotplug functions

Kernel 5.15 commit 8c854303ce0e38e5bbedd725ff39da7e235865d8
removed deprecated CPU-hotplug functions get_online_cpus()
and put_online_cpus(). They map directly to cpus_read_lock()
and cpus_read_unlock().

Change-Id: I09d489cd3ca9a575b20ea25f24210702fbfdd725
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46085
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
---
 libcfs/libcfs/libcfs_cpu.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/libcfs/libcfs/libcfs_cpu.c
+++ b/libcfs/libcfs/libcfs_cpu.c
@@ -1207,7 +1207,7 @@ int cfs_cpu_init(void)
 #endif /* !HAVE_HOTPLUG_STATE_MACHINE */
 #endif /* CONFIG_HOTPLUG_CPU */
 
-	get_online_cpus();
+	cpus_read_lock();
 	if (*cpu_pattern) {
 		cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern);
 		if (IS_ERR(cfs_cpt_table)) {
@@ -1227,7 +1227,7 @@ int cfs_cpu_init(void)
 		}
 	}
 
-	put_online_cpus();
+	cpus_read_unlock();
 
 	LCONSOLE(0, "HW NUMA nodes: %d, HW CPU cores: %d, npartitions: %d\n",
 		 num_online_nodes(), num_online_cpus(),
@@ -1235,7 +1235,7 @@ int cfs_cpu_init(void)
 	return 0;
 
 failed_alloc_table:
-	put_online_cpus();
+	cpus_read_unlock();
 
 	if (!IS_ERR_OR_NULL(cfs_cpt_table))
 		cfs_cpt_table_free(cfs_cpt_table);
openSUSE Build Service is sponsored by