Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318344
b: refs/heads/master
c: 3987103
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu committed Jun 22, 2012
1 parent 225438d commit e8f5bdc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 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: 3387e7d69048f5ab02729825f9611754850d9a87
refs/heads/master: 398710379f516012c52d2ae396a9ba919bd6a7ab
17 changes: 0 additions & 17 deletions trunk/crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@

static LIST_HEAD(crypto_template_list);

void crypto_larval_error(const char *name, u32 type, u32 mask)
{
struct crypto_alg *alg;

alg = crypto_alg_lookup(name, type, mask);

if (alg) {
if (crypto_is_larval(alg)) {
struct crypto_larval *larval = (void *)alg;
complete_all(&larval->completion);
}
crypto_mod_put(alg);
}
}
EXPORT_SYMBOL_GPL(crypto_larval_error);

static inline int crypto_set_driver_name(struct crypto_alg *alg)
{
static const char suffix[] = "-generic";
Expand Down Expand Up @@ -295,7 +279,6 @@ void crypto_alg_tested(const char *name, int err)
continue;

larval->adult = alg;
complete_all(&larval->completion);
continue;
}

Expand Down
17 changes: 9 additions & 8 deletions trunk/crypto/algboss.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

#include <crypto/internal/aead.h>
#include <linux/completion.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/init.h>
Expand Down Expand Up @@ -47,6 +48,8 @@ struct cryptomgr_param {
char larval[CRYPTO_MAX_ALG_NAME];
char template[CRYPTO_MAX_ALG_NAME];

struct completion *completion;

u32 otype;
u32 omask;
};
Expand All @@ -66,7 +69,7 @@ static int cryptomgr_probe(void *data)

tmpl = crypto_lookup_template(param->template);
if (!tmpl)
goto err;
goto out;

do {
if (tmpl->create) {
Expand All @@ -83,16 +86,10 @@ static int cryptomgr_probe(void *data)

crypto_tmpl_put(tmpl);

if (err)
goto err;

out:
complete(param->completion);
kfree(param);
module_put_and_exit(0);

err:
crypto_larval_error(param->larval, param->otype, param->omask);
goto out;
}

static int cryptomgr_schedule_probe(struct crypto_larval *larval)
Expand Down Expand Up @@ -192,10 +189,14 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)

memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME);

param->completion = &larval->completion;

thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe");
if (IS_ERR(thread))
goto err_free_param;

wait_for_completion_interruptible(&larval->completion);

return NOTIFY_STOP;

err_free_param:
Expand Down
1 change: 0 additions & 1 deletion trunk/crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ void crypto_exit_compress_ops(struct crypto_tfm *tfm);
struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask);
void crypto_larval_kill(struct crypto_alg *alg);
struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask);
void crypto_larval_error(const char *name, u32 type, u32 mask);
void crypto_alg_tested(const char *name, int err);

void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list,
Expand Down

0 comments on commit e8f5bdc

Please sign in to comment.