]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[CRYPTO] api: Feed flag directly to crypto_yield
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 30 Jul 2006 01:53:45 +0000 (11:53 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 21 Sep 2006 01:41:50 +0000 (11:41 +1000)
The sleeping flag used to determine whether crypto_yield can actually
yield is really a per-operation flag rather than a per-tfm flag.  This
patch changes crypto_yield to take a flag directly so that we can start
using a per-operation flag instead the tfm flag.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/cipher.c
crypto/digest.c
crypto/internal.h

index aebc4a2adc8059a0aa4188338bd05c90aa1eb498..f573c59ed9dc734ca1447c5f3fb33efd421382f4 100644 (file)
@@ -145,7 +145,7 @@ static int crypt(const struct cipher_desc *desc,
                if (!nbytes)
                        break;
 
-               crypto_yield(tfm);
+               crypto_yield(tfm->crt_flags);
        }
 
        if (buffer)
index 19e75563776bbe7309801fe574a10bbb984bce0d..96244a528844d1785a0dea80a42b805312075420 100644 (file)
@@ -55,7 +55,7 @@ static void update(struct crypto_tfm *tfm,
                        tfm->__crt_alg->cra_digest.dia_update(tfm, p,
                                                              bytes_from_page);
                        crypto_kunmap(src, 0);
-                       crypto_yield(tfm);
+                       crypto_yield(tfm->crt_flags);
                        offset = 0;
                        pg++;
                        l -= bytes_from_page;
index b110b979b9888b38a00e7c2e3a53744fbe1a3458..7dc04efb55c6c3c1b5996094c346934d22a547f9 100644 (file)
@@ -67,9 +67,9 @@ static inline void crypto_kunmap(void *vaddr, int out)
        kunmap_atomic(vaddr, crypto_kmap_type(out));
 }
 
-static inline void crypto_yield(struct crypto_tfm *tfm)
+static inline void crypto_yield(u32 flags)
 {
-       if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP)
+       if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
                cond_resched();
 }