From 9c8cbe47173cb5d3b6a19ebdc666bc1a80d6e76b Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Mon, 24 Jan 2022 12:59:19 -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(). Lustre-change: https://review.whamcloud.com/46085 Lustre-commit: TBD (from c531bac68680b899ba34a4e16bd8528937b4f06b) Change-Id: I09d489cd3ca9a575b20ea25f24210702fbfdd725 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/46288 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- libcfs/libcfs/libcfs_cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcfs/libcfs/libcfs_cpu.c b/libcfs/libcfs/libcfs_cpu.c index aa2c6b4..4be0b02 100644 --- a/libcfs/libcfs/libcfs_cpu.c +++ b/libcfs/libcfs/libcfs_cpu.c @@ -1223,7 +1223,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_tab = cfs_cpt_table_create_pattern(cpu_pattern); if (IS_ERR(cfs_cpt_tab)) { @@ -1243,7 +1243,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(), @@ -1251,7 +1251,7 @@ int cfs_cpu_init(void) return 0; failed_alloc_table: - put_online_cpus(); + cpus_read_unlock(); if (!IS_ERR_OR_NULL(cfs_cpt_tab)) cfs_cpt_table_free(cfs_cpt_tab); -- 1.8.3.1