Skip to content

Commit 80771c8

Browse files
Sebastian Andrzej Siewiorherbertx
authored andcommitted
padata: Replace deprecated CPU-hotplug functions.
The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Steffen Klassert <[email protected]> Cc: Daniel Jordan <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Daniel Jordan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent d01a9f7 commit 80771c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kernel/padata.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
733733
struct cpumask *serial_mask, *parallel_mask;
734734
int err = -EINVAL;
735735

736-
get_online_cpus();
736+
cpus_read_lock();
737737
mutex_lock(&pinst->lock);
738738

739739
switch (cpumask_type) {
@@ -753,7 +753,7 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
753753

754754
out:
755755
mutex_unlock(&pinst->lock);
756-
put_online_cpus();
756+
cpus_read_unlock();
757757

758758
return err;
759759
}
@@ -992,7 +992,7 @@ struct padata_instance *padata_alloc(const char *name)
992992
if (!pinst->parallel_wq)
993993
goto err_free_inst;
994994

995-
get_online_cpus();
995+
cpus_read_lock();
996996

997997
pinst->serial_wq = alloc_workqueue("%s_serial", WQ_MEM_RECLAIM |
998998
WQ_CPU_INTENSIVE, 1, name);
@@ -1026,7 +1026,7 @@ struct padata_instance *padata_alloc(const char *name)
10261026
&pinst->cpu_dead_node);
10271027
#endif
10281028

1029-
put_online_cpus();
1029+
cpus_read_unlock();
10301030

10311031
return pinst;
10321032

@@ -1036,7 +1036,7 @@ struct padata_instance *padata_alloc(const char *name)
10361036
err_free_serial_wq:
10371037
destroy_workqueue(pinst->serial_wq);
10381038
err_put_cpus:
1039-
put_online_cpus();
1039+
cpus_read_unlock();
10401040
destroy_workqueue(pinst->parallel_wq);
10411041
err_free_inst:
10421042
kfree(pinst);
@@ -1074,9 +1074,9 @@ struct padata_shell *padata_alloc_shell(struct padata_instance *pinst)
10741074

10751075
ps->pinst = pinst;
10761076

1077-
get_online_cpus();
1077+
cpus_read_lock();
10781078
pd = padata_alloc_pd(ps);
1079-
put_online_cpus();
1079+
cpus_read_unlock();
10801080

10811081
if (!pd)
10821082
goto out_free_ps;

0 commit comments

Comments
 (0)