aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-04-13 14:24:17 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-04-20 18:20:04 +0800
commit3c3a24cb0ae46c9c45e4ce2272f84f0504831f59 (patch)
treeeea759615e4d97e662e0fa76f60b7eb786891e8b /crypto/internal.h
parentae131f4970f0778f35ed06aeb15bde2fbc1d9619 (diff)
downloadlinux-3c3a24cb0ae46c9c45e4ce2272f84f0504831f59.tar.gz
crypto: api - Add crypto_clone_tfm
This patch adds the helper crypto_clone_tfm. The purpose is to allocate a tfm object with GFP_ATOMIC. As we cannot sleep, the object has to be cloned from an existing tfm object. This allows code paths that cannot otherwise allocate a crypto_tfm object to do so. Once a new tfm has been obtained its key could then be changed without impacting other users. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 5eee009ee494d..8dd746b1130b6 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -106,6 +106,8 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
u32 mask);
void *crypto_create_tfm_node(struct crypto_alg *alg,
const struct crypto_type *frontend, int node);
+void *crypto_clone_tfm(const struct crypto_type *frontend,
+ struct crypto_tfm *otfm);
static inline void *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend)