return __lzorle_compress(src, slen, dst, dlen, ctx->lzorle_comp_mem);
#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/vmalloc.h>
#include <crypto/internal/scompress.h>
static void *lzorle_alloc_ctx(struct crypto_scomp *tfm)
ctx = kvmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL);
static int lzorle_init(struct crypto_tfm *tfm)
struct lzorle_ctx *ctx = crypto_tfm_ctx(tfm);
ctx->lzorle_comp_mem = lzorle_alloc_ctx(NULL);
if (IS_ERR(ctx->lzorle_comp_mem))
static void lzorle_free_ctx(struct crypto_scomp *tfm, void *ctx)
static void lzorle_exit(struct crypto_tfm *tfm)
struct lzorle_ctx *ctx = crypto_tfm_ctx(tfm);
lzorle_free_ctx(NULL, ctx->lzorle_comp_mem);
static int __lzorle_compress(const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen, void *ctx)
err = lzorle1x_1_compress(src, slen, dst, &tmp_len, ctx);