summaryrefslogtreecommitdiff
path: root/include/crypto/algapi.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-03-17 16:33:54 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-07 13:22:25 +0800
commit3860642e0a87c8aef3c4285f3bb4ad473cfd514f (patch)
tree543e25edc6299ebebe90a198b62d5566efec4776 /include/crypto/algapi.h
parent1ddaff40c08abb926be5ba713c5efc412d0836c5 (diff)
crypto: api - Move alg destroy work from instance to template
Commit 9ae4577bc077 ("crypto: api - Use work queue in crypto_destroy_instance") introduced a work struct to free an instance after the last user goes away. Move the delayed work from the instance into its template so that when the template is unregistered it can ensure that all its instances have been freed before returning. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r--include/crypto/algapi.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 6e07bbc04089..03b7eca8af9a 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -68,16 +68,17 @@ struct crypto_instance {
struct crypto_spawn *spawns;
};
- struct work_struct free_work;
-
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
struct crypto_template {
struct list_head list;
struct hlist_head instances;
+ struct hlist_head dead;
struct module *module;
+ struct work_struct free_work;
+
int (*create)(struct crypto_template *tmpl, struct rtattr **tb);
char name[CRYPTO_MAX_ALG_NAME];