Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196726
b: refs/heads/master
c: 6751fb3
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and Herbert Xu committed May 3, 2010
1 parent 9d3d331 commit 4d907b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b389b2cc539dc2dc60b049240942be54958c93a
refs/heads/master: 6751fb3c0e0cfcc40a1a0acabca97370c9ec6c6b
13 changes: 13 additions & 0 deletions trunk/kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ int padata_set_cpumask(struct padata_instance *pinst,

mutex_lock(&pinst->lock);

get_online_cpus();

pd = padata_alloc_pd(pinst, cpumask);
if (!pd) {
err = -ENOMEM;
Expand All @@ -452,6 +454,8 @@ int padata_set_cpumask(struct padata_instance *pinst,
padata_replace(pinst, pd);

out:
put_online_cpus();

mutex_unlock(&pinst->lock);

return err;
Expand Down Expand Up @@ -485,8 +489,10 @@ int padata_add_cpu(struct padata_instance *pinst, int cpu)

mutex_lock(&pinst->lock);

get_online_cpus();
cpumask_set_cpu(cpu, pinst->cpumask);
err = __padata_add_cpu(pinst, cpu);
put_online_cpus();

mutex_unlock(&pinst->lock);

Expand Down Expand Up @@ -521,8 +527,10 @@ int padata_remove_cpu(struct padata_instance *pinst, int cpu)

mutex_lock(&pinst->lock);

get_online_cpus();
cpumask_clear_cpu(cpu, pinst->cpumask);
err = __padata_remove_cpu(pinst, cpu);
put_online_cpus();

mutex_unlock(&pinst->lock);

Expand Down Expand Up @@ -626,6 +634,8 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask,
if (!pinst)
goto err;

get_online_cpus();

pd = padata_alloc_pd(pinst, cpumask);
if (!pd)
goto err_free_inst;
Expand All @@ -647,6 +657,8 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask,
register_hotcpu_notifier(&pinst->cpu_notifier);
#endif

put_online_cpus();

mutex_init(&pinst->lock);

return pinst;
Expand All @@ -655,6 +667,7 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask,
padata_free_pd(pd);
err_free_inst:
kfree(pinst);
put_online_cpus();
err:
return NULL;
}
Expand Down

0 comments on commit 4d907b0

Please sign in to comment.