diff options
author | Giovanni Cabiddu <giovanni.cabiddu@intel.com> | 2016-10-21 14:19:48 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-10-25 05:08:31 +0200 |
commit | 1ab53a77b772bf7369464a0e4fa6fd6499acf8f1 (patch) | |
tree | 781b6c458c8bdc4dfb52e1f91707a108a96f6f98 /include/crypto/internal/acompress.h | |
parent | crypto: acomp - add asynchronous compression api (diff) | |
download | linux-1ab53a77b772bf7369464a0e4fa6fd6499acf8f1.tar.xz linux-1ab53a77b772bf7369464a0e4fa6fd6499acf8f1.zip |
crypto: acomp - add driver-side scomp interface
Add a synchronous back-end (scomp) to acomp. This allows to easily
expose the already present compression algorithms in LKCF via acomp.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal/acompress.h')
-rw-r--r-- | include/crypto/internal/acompress.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/crypto/internal/acompress.h b/include/crypto/internal/acompress.h index a9a9000d1aea..1de2b5af12d7 100644 --- a/include/crypto/internal/acompress.h +++ b/include/crypto/internal/acompress.h @@ -39,6 +39,21 @@ static inline const char *acomp_alg_name(struct crypto_acomp *tfm) return crypto_acomp_tfm(tfm)->__crt_alg->cra_name; } +static inline struct acomp_req *__acomp_request_alloc(struct crypto_acomp *tfm) +{ + struct acomp_req *req; + + req = kzalloc(sizeof(*req) + crypto_acomp_reqsize(tfm), GFP_KERNEL); + if (likely(req)) + acomp_request_set_tfm(req, tfm); + return req; +} + +static inline void __acomp_request_free(struct acomp_req *req) +{ + kzfree(req); +} + /** * crypto_register_acomp() -- Register asynchronous compression algorithm * |