]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: api - Remove per-tfm refcount
authorEric Biggers <ebiggers@kernel.org>
Fri, 22 May 2026 05:30:26 +0000 (00:30 -0500)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 May 2026 00:45:46 +0000 (17:45 -0700)
commit3065170bfc7f256f9d1339062dae331f731c6763
tree649d7939c5cc51ce40b60ef02c4854970b61d863
parent590a46c68a7b0f9ebbd0248a5a00c472f249c204
crypto: api - Remove per-tfm refcount

This reverts commit ae131f4970f0 ("crypto: api - Add crypto_tfm_get").

The refcount in struct crypto_tfm was added solely to support
crypto_clone_tfm().  Before then it was a simple non-refcounted object.

Since crypto_clone_tfm() has been removed, remove the refcount as well.

Note that this eliminates an expensive atomic operation from every tfm
freeing operation.  So this revert doesn't just remove unused code, but
it also fixes a performance regression.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://patch.msgid.link/20260522053028.91165-5-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
crypto/api.c
crypto/internal.h
include/linux/crypto.h