Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204363
b: refs/heads/master
c: d3f64e4
h: refs/heads/master
i:
  204361: 4f4d609
  204359: ee9cf50
v: v3
  • Loading branch information
Steffen Klassert authored and Herbert Xu committed Jul 31, 2010
1 parent 067fefb commit 9c97a64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c57e842eff49b05c4642dd7cfb1e7aa62ab932fa
refs/heads/master: d3f64e46aa21dd86a239274d218ec286461bfa68
13 changes: 11 additions & 2 deletions trunk/crypto/pcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/notifier.h>
#include <linux/kobject.h>
#include <linux/cpu.h>
#include <crypto/pcrypt.h>

struct padata_pcrypt {
Expand Down Expand Up @@ -409,6 +410,7 @@ static int pcrypt_cpumask_change_notify(struct notifier_block *self,
{
struct padata_pcrypt *pcrypt;
struct pcrypt_cpumask *new_mask, *old_mask;
struct padata_cpumask *cpumask = (struct padata_cpumask *)data;

if (!(val & PADATA_CPU_SERIAL))
return 0;
Expand All @@ -424,7 +426,7 @@ static int pcrypt_cpumask_change_notify(struct notifier_block *self,

old_mask = pcrypt->cb_cpumask;

padata_get_cpumask(pcrypt->pinst, PADATA_CPU_SERIAL, new_mask->mask);
cpumask_copy(new_mask->mask, cpumask->cbcpu);
rcu_assign_pointer(pcrypt->cb_cpumask, new_mask);
synchronize_rcu_bh();

Expand All @@ -451,6 +453,8 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
int ret = -ENOMEM;
struct pcrypt_cpumask *mask;

get_online_cpus();

pcrypt->wq = create_workqueue(name);
if (!pcrypt->wq)
goto err;
Expand All @@ -467,7 +471,7 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
goto err_free_padata;
}

padata_get_cpumask(pcrypt->pinst, PADATA_CPU_SERIAL, mask->mask);
cpumask_and(mask->mask, cpu_possible_mask, cpu_active_mask);
rcu_assign_pointer(pcrypt->cb_cpumask, mask);

pcrypt->nblock.notifier_call = pcrypt_cpumask_change_notify;
Expand All @@ -479,7 +483,10 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
if (ret)
goto err_unregister_notifier;

put_online_cpus();

return ret;

err_unregister_notifier:
padata_unregister_cpumask_notifier(pcrypt->pinst, &pcrypt->nblock);
err_free_cpumask:
Expand All @@ -490,6 +497,8 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
err_destroy_workqueue:
destroy_workqueue(pcrypt->wq);
err:
put_online_cpus();

return ret;
}

Expand Down

0 comments on commit 9c97a64

Please sign in to comment.