summaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-02-16 11:35:17 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2023-03-14 10:06:42 +0100
commit0a742389bcc00053d63b5271fefb00d3a338d512 (patch)
treeedac516a4c4495ca15362e1fe7074c68647389de /crypto/algapi.c
parentcrypto: hash - Count error stats differently (diff)
downloadlinux-0a742389bcc00053d63b5271fefb00d3a338d512.tar.xz
linux-0a742389bcc00053d63b5271fefb00d3a338d512.zip
crypto: acomp - Count error stats differently
Move all stat code specific to acomp into the acomp code. While we're at it, change the stats so that bytes and counts are always incremented even in case of error. This allows the reference counting to be removed as we can now increment the counters prior to the operation. After the operation we simply increase the error count if necessary. This is safe as errors can only occur synchronously (or rather, the existing code already ignored asynchronous errors which are only visible to the callback function). Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index deabd2d42216..fe48ce1957e1 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -1051,30 +1051,6 @@ void crypto_stats_get(struct crypto_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_stats_get);
-void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg)
-{
- if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->stats.compress.err_cnt);
- } else {
- atomic64_inc(&alg->stats.compress.compress_cnt);
- atomic64_add(slen, &alg->stats.compress.compress_tlen);
- }
- crypto_alg_put(alg);
-}
-EXPORT_SYMBOL_GPL(crypto_stats_compress);
-
-void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg)
-{
- if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->stats.compress.err_cnt);
- } else {
- atomic64_inc(&alg->stats.compress.decompress_cnt);
- atomic64_add(slen, &alg->stats.compress.decompress_tlen);
- }
- crypto_alg_put(alg);
-}
-EXPORT_SYMBOL_GPL(crypto_stats_decompress);
-
void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret)
{
if (ret)