aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-07-30 11:53:45 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-21 11:41:50 +1000
commit8f21cf0d2bae04ece761595036c9da8328b279aa (patch)
tree4025d020895dcbfc2aef330fed01860bbf0ba64d
parent6d7d684d635ac5a345f075015f2c84169c111c6a (diff)
[CRYPTO] api: Feed flag directly to crypto_yield
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>
-rw-r--r--crypto/cipher.c2
-rw-r--r--crypto/digest.c2
-rw-r--r--crypto/internal.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/crypto/cipher.c b/crypto/cipher.c
index aebc4a2adc8..f573c59ed9d 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -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)
diff --git a/crypto/digest.c b/crypto/digest.c
index 19e75563776..96244a52884 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -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;
diff --git a/crypto/internal.h b/crypto/internal.h
index b110b979b98..7dc04efb55c 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -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();
}