summaryrefslogtreecommitdiffstats
path: root/crypto/api.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-09-01 17:43:05 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-01 17:43:05 -0700
commit64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6 (patch)
tree2bae23bf3d7378ba2d60be8aee6b0178d1d9c721 /crypto/api.c
parentfb4f10ed50f01b0f953068456bfb6e2885921b01 (diff)
downloadblackbird-op-linux-64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6.tar.gz
blackbird-op-linux-64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6.zip
[CRYPTO]: Added CRYPTO_TFM_REQ_MAY_SLEEP flag
The crypto layer currently uses in_atomic() to determine whether it is allowed to sleep. This is incorrect since spin locks don't always cause in_atomic() to return true. Instead of that, this patch returns to an earlier idea of a per-tfm flag which determines whether sleeping is allowed. Unlike the earlier version, the default is to not allow sleeping. This ensures that no existing code can break. As usual, this flag may either be set through crypto_alloc_tfm(), or just before a specific crypto operation. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/api.c b/crypto/api.c
index b4728811ce3b..959c4e5f264f 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -66,7 +66,8 @@ static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name)
static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags)
{
- tfm->crt_flags = 0;
+ tfm->crt_flags = flags & CRYPTO_TFM_REQ_MASK;
+ flags &= ~CRYPTO_TFM_REQ_MASK;
switch (crypto_tfm_alg_type(tfm)) {
case CRYPTO_ALG_TYPE_CIPHER:
OpenPOWER on IntegriCloud