Commit 30d67695 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Export cpu notifiers and do locking.

The registration and unregistration of CPU notifiers should be done
under the cpucontrol sem.  They should also be exported.
parent ea747b67
...@@ -19,13 +19,23 @@ static struct notifier_block *cpu_chain; ...@@ -19,13 +19,23 @@ static struct notifier_block *cpu_chain;
/* Need to know about CPUs going up/down? */ /* Need to know about CPUs going up/down? */
int register_cpu_notifier(struct notifier_block *nb) int register_cpu_notifier(struct notifier_block *nb)
{ {
return notifier_chain_register(&cpu_chain, nb); int ret;
if ((ret = down_interruptible(&cpucontrol)) != 0)
return ret;
ret = notifier_chain_register(&cpu_chain, nb);
up(&cpucontrol);
return ret;
} }
EXPORT_SYMBOL(register_cpu_notifier);
void unregister_cpu_notifier(struct notifier_block *nb) void unregister_cpu_notifier(struct notifier_block *nb)
{ {
notifier_chain_unregister(&cpu_chain,nb); down(&cpucontrol);
notifier_chain_unregister(&cpu_chain, nb);
up(&cpucontrol);
} }
EXPORT_SYMBOL(unregister_cpu_notifier);
int __devinit cpu_up(unsigned int cpu) int __devinit cpu_up(unsigned int cpu)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment