]> err.no Git - linux-2.6/commitdiff
[CRYPTO] api: Wake up all waiters when larval completes
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 19 May 2007 07:51:40 +0000 (17:51 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Jul 2007 12:58:53 +0000 (20:58 +0800)
Right now when a larval matures or when it dies of an error we
only wake up one waiter.  This would cause other waiters to timeout
unnecessarily.  This patch changes it to use complete_all to wake
up all waiters.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c
crypto/api.c

index f137a432061f4224ccbff0bef41c58d95c859921..38aa9e994703829a40bd6a09542f0cef97b63fef 100644 (file)
@@ -34,7 +34,7 @@ void crypto_larval_error(const char *name, u32 type, u32 mask)
        if (alg) {
                if (crypto_is_larval(alg)) {
                        struct crypto_larval *larval = (void *)alg;
-                       complete(&larval->completion);
+                       complete_all(&larval->completion);
                }
                crypto_mod_put(alg);
        }
@@ -164,7 +164,7 @@ static int __crypto_register_alg(struct crypto_alg *alg,
                                continue;
 
                        larval->adult = alg;
-                       complete(&larval->completion);
+                       complete_all(&larval->completion);
                        continue;
                }
 
index 33734fd9198f09f829da60fe14d6b06dd8e40515..4ccc5af6c26530c81d0da2a6fed9b7bf609c2b8c 100644 (file)
@@ -144,7 +144,7 @@ static void crypto_larval_kill(struct crypto_alg *alg)
        down_write(&crypto_alg_sem);
        list_del(&alg->cra_list);
        up_write(&crypto_alg_sem);
-       complete(&larval->completion);
+       complete_all(&larval->completion);
        crypto_alg_put(alg);
 }