aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/compress.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-02-16 18:35:17 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-03-14 17:06:42 +0800
commit0a742389bcc00053d63b5271fefb00d3a338d512 (patch)
treeedac516a4c4495ca15362e1fe7074c68647389de /crypto/compress.h
parent42808e5dc602c12ef3eb42cf96cb416b55205fa4 (diff)
downloadlinux-0a742389bcc00053d63b5271fefb00d3a338d512.tar.gz
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/compress.h')
-rw-r--r--crypto/compress.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/compress.h b/crypto/compress.h
new file mode 100644
index 00000000000000..19f65516d699c0
--- /dev/null
+++ b/crypto/compress.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Cryptographic API.
+ *
+ * Copyright 2015 LG Electronics Inc.
+ * Copyright (c) 2016, Intel Corporation
+ * Copyright (c) 2023 Herbert Xu <herbert@gondor.apana.org.au>
+ */
+#ifndef _LOCAL_CRYPTO_COMPRESS_H
+#define _LOCAL_CRYPTO_COMPRESS_H
+
+#include "internal.h"
+
+struct acomp_req;
+struct comp_alg_common;
+struct sk_buff;
+
+int crypto_init_scomp_ops_async(struct crypto_tfm *tfm);
+struct acomp_req *crypto_acomp_scomp_alloc_ctx(struct acomp_req *req);
+void crypto_acomp_scomp_free_ctx(struct acomp_req *req);
+
+int crypto_acomp_report_stat(struct sk_buff *skb, struct crypto_alg *alg);
+
+void comp_prepare_alg(struct comp_alg_common *alg);
+
+#endif /* _LOCAL_CRYPTO_COMPRESS_H */