summaryrefslogtreecommitdiff
path: root/include/crypto/acompress.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-04-23 17:22:28 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-28 19:40:54 +0800
commit19da081a28c95fe9b03ce952a2bf4a6f6bf5112c (patch)
tree224f4fc987087caa04437c1c10b26256cb7b245d /include/crypto/acompress.h
parentaf9ce62783dd6acd595491badec08f1235c84739 (diff)
crypto: api - Add crypto_request_clone and fb
Add a helper to clone crypto requests and eliminate code duplication. Use kmemdup in the helper. Also add an fb field to crypto_tfm. This also happens to fix the existing implementations which were buggy. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504230118.1CxUaUoX-lkp@intel.com/ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504230004.c7mrY0C6-lkp@intel.com/ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/acompress.h')
-rw-r--r--include/crypto/acompress.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h
index 1b30290d6380..933c48a4855b 100644
--- a/include/crypto/acompress.h
+++ b/include/crypto/acompress.h
@@ -114,7 +114,6 @@ struct crypto_acomp {
int (*compress)(struct acomp_req *req);
int (*decompress)(struct acomp_req *req);
unsigned int reqsize;
- struct crypto_acomp *fb;
struct crypto_tfm base;
};
@@ -553,7 +552,11 @@ static inline struct acomp_req *acomp_request_on_stack_init(
return req;
}
-struct acomp_req *acomp_request_clone(struct acomp_req *req,
- size_t total, gfp_t gfp);
+static inline struct acomp_req *acomp_request_clone(struct acomp_req *req,
+ size_t total, gfp_t gfp)
+{
+ return container_of(crypto_request_clone(&req->base, total, gfp),
+ struct acomp_req, base);
+}
#endif