diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-09-02 04:43:05 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-02 04:43:05 +0400 |
commit | 64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6 (patch) | |
tree | 2bae23bf3d7378ba2d60be8aee6b0178d1d9c721 /include/linux/crypto.h | |
parent | fb4f10ed50f01b0f953068456bfb6e2885921b01 (diff) | |
download | linux-64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6.tar.xz |
[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 'include/linux/crypto.h')
-rw-r--r-- | include/linux/crypto.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 5e2bcc636a02..3c89df6e7768 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -45,6 +45,7 @@ #define CRYPTO_TFM_MODE_CTR 0x00000008 #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 +#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 |