diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-07-07 09:30:10 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-07-14 08:29:28 -0400 |
commit | 4c879170296174bde05cd1c643dac16594edee77 (patch) | |
tree | 467afaa9ad1235caa110789621edb7726fdcb4cd /kernel/padata.c | |
parent | 7e3de7b1be6ce0643f60aed697070e2286db32cd (diff) |
padata: Check for valid padata instance on start
This patch introduces the PADATA_INVALID flag which is
checked on padata start. This will be used to mark a padata
instance as invalid, if the padata cpumask does not intersect
with the active cpumask. we change padata_start to return an
error if the PADATA_INVALID is set. Also we adapt the only
padata user, pcrypt to this change.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'kernel/padata.c')
-rw-r--r-- | kernel/padata.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index ff8de1b71e4e..e7d723a3e31d 100644 --- a/kernel/padata.c +++ b/kernel/padata.c | |||
@@ -485,6 +485,11 @@ static void padata_flush_queues(struct parallel_data *pd) | |||
485 | BUG_ON(atomic_read(&pd->refcnt) != 0); | 485 | BUG_ON(atomic_read(&pd->refcnt) != 0); |
486 | } | 486 | } |
487 | 487 | ||
488 | static void __padata_start(struct padata_instance *pinst) | ||
489 | { | ||
490 | pinst->flags |= PADATA_INIT; | ||
491 | } | ||
492 | |||
488 | /* Replace the internal control stucture with a new one. */ | 493 | /* Replace the internal control stucture with a new one. */ |
489 | static void padata_replace(struct padata_instance *pinst, | 494 | static void padata_replace(struct padata_instance *pinst, |
490 | struct parallel_data *pd_new) | 495 | struct parallel_data *pd_new) |
@@ -619,11 +624,20 @@ EXPORT_SYMBOL(padata_remove_cpu); | |||
619 | * | 624 | * |
620 | * @pinst: padata instance to start | 625 | * @pinst: padata instance to start |
621 | */ | 626 | */ |
622 | void padata_start(struct padata_instance *pinst) | 627 | int padata_start(struct padata_instance *pinst) |
623 | { | 628 | { |
629 | int err = 0; | ||
630 | |||
624 | mutex_lock(&pinst->lock); | 631 | mutex_lock(&pinst->lock); |
625 | pinst->flags |= PADATA_INIT; | 632 | |
633 | if (pinst->flags & PADATA_INVALID) | ||
634 | err =-EINVAL; | ||
635 | |||
636 | __padata_start(pinst); | ||
637 | |||
626 | mutex_unlock(&pinst->lock); | 638 | mutex_unlock(&pinst->lock); |
639 | |||
640 | return err; | ||
627 | } | 641 | } |
628 | EXPORT_SYMBOL(padata_start); | 642 | EXPORT_SYMBOL(padata_start); |
629 | 643 | ||