Lines Matching refs:zctx
103 struct zstd_ctx *zctx = ctx->context; in zstd_destroy() local
105 if (!zctx) in zstd_destroy()
115 if (zctx->cctx_mem) in zstd_destroy()
116 vfree(zctx->cctx_mem); in zstd_destroy()
118 zstd_free_cctx(zctx->cctx); in zstd_destroy()
120 if (zctx->dctx_mem) in zstd_destroy()
121 vfree(zctx->dctx_mem); in zstd_destroy()
123 zstd_free_dctx(zctx->dctx); in zstd_destroy()
125 kfree(zctx); in zstd_destroy()
130 struct zstd_ctx *zctx; in zstd_create() local
134 zctx = kzalloc(sizeof(*zctx), GFP_KERNEL); in zstd_create()
135 if (!zctx) in zstd_create()
138 ctx->context = zctx; in zstd_create()
142 zctx->cctx_mem = vzalloc(sz); in zstd_create()
143 if (!zctx->cctx_mem) in zstd_create()
146 zctx->cctx = zstd_init_cctx(zctx->cctx_mem, sz); in zstd_create()
147 if (!zctx->cctx) in zstd_create()
151 zctx->dctx_mem = vzalloc(sz); in zstd_create()
152 if (!zctx->dctx_mem) in zstd_create()
155 zctx->dctx = zstd_init_dctx(zctx->dctx_mem, sz); in zstd_create()
156 if (!zctx->dctx) in zstd_create()
161 zctx->cctx = zstd_create_cctx_advanced(zp->custom_mem); in zstd_create()
162 if (!zctx->cctx) in zstd_create()
165 zctx->dctx = zstd_create_dctx_advanced(zp->custom_mem); in zstd_create()
166 if (!zctx->dctx) in zstd_create()
182 struct zstd_ctx *zctx = ctx->context; in zstd_compress() local
186 ret = zstd_compress_cctx(zctx->cctx, req->dst, req->dst_len, in zstd_compress()
189 ret = zstd_compress_using_cdict(zctx->cctx, req->dst, in zstd_compress()
203 struct zstd_ctx *zctx = ctx->context; in zstd_decompress() local
207 ret = zstd_decompress_dctx(zctx->dctx, req->dst, req->dst_len, in zstd_decompress()
210 ret = zstd_decompress_using_ddict(zctx->dctx, req->dst, in zstd_decompress()