X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=crypto%2Fcryptd.c;h=8bf2da835f7beae4513e164b59622d56e0387a76;hb=de47062a17a236543690e0c23dfb30cb11c6e674;hp=3ff4e1f0f0328d9acb023628e4233b0b1acd607e;hpb=89661adaaee2f85116b399e642129ccd4dafd195;p=cascardo%2Flinux.git diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 3ff4e1f0f032..8bf2da835f7b 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -131,7 +131,7 @@ static int cryptd_blkcipher_enqueue(struct ablkcipher_request *req, req->base.complete = complete; spin_lock_bh(&state->lock); - err = ablkcipher_enqueue_request(crypto_ablkcipher_alg(tfm), req); + err = ablkcipher_enqueue_request(&state->queue, req); spin_unlock_bh(&state->lock); wake_up_process(state->task); @@ -173,7 +173,8 @@ static void cryptd_blkcipher_exit_tfm(struct crypto_tfm *tfm) int active; mutex_lock(&state->mutex); - active = ablkcipher_tfm_in_queue(__crypto_ablkcipher_cast(tfm)); + active = ablkcipher_tfm_in_queue(&state->queue, + __crypto_ablkcipher_cast(tfm)); mutex_unlock(&state->mutex); BUG_ON(active); @@ -251,8 +252,6 @@ static struct crypto_instance *cryptd_alloc_blkcipher( inst->alg.cra_ablkcipher.encrypt = cryptd_blkcipher_encrypt_enqueue; inst->alg.cra_ablkcipher.decrypt = cryptd_blkcipher_decrypt_enqueue; - inst->alg.cra_ablkcipher.queue = &state->queue; - out_put_alg: crypto_mod_put(alg); return inst; @@ -298,7 +297,7 @@ static inline int cryptd_create_thread(struct cryptd_state *state, mutex_init(&state->mutex); crypto_init_queue(&state->queue, CRYPTD_MAX_QLEN); - state->task = kthread_create(fn, state, name); + state->task = kthread_run(fn, state, name); if (IS_ERR(state->task)) return PTR_ERR(state->task); @@ -316,6 +315,8 @@ static int cryptd_thread(void *data) struct cryptd_state *state = data; int stop; + current->flags |= PF_NOFREEZE; + do { struct crypto_async_request *req, *backlog;