Lines Matching refs:zstrm
37 static void zcomp_strm_free(struct zcomp_strm *zstrm) in zcomp_strm_free() argument
39 if (!IS_ERR_OR_NULL(zstrm->tfm)) in zcomp_strm_free()
40 crypto_free_comp(zstrm->tfm); in zcomp_strm_free()
41 vfree(zstrm->buffer); in zcomp_strm_free()
42 zstrm->tfm = NULL; in zcomp_strm_free()
43 zstrm->buffer = NULL; in zcomp_strm_free()
50 static int zcomp_strm_init(struct zcomp_strm *zstrm, struct zcomp *comp) in zcomp_strm_init() argument
52 zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0); in zcomp_strm_init()
57 zstrm->buffer = vzalloc(2 * PAGE_SIZE); in zcomp_strm_init()
58 if (IS_ERR_OR_NULL(zstrm->tfm) || !zstrm->buffer) { in zcomp_strm_init()
59 zcomp_strm_free(zstrm); in zcomp_strm_init()
118 int zcomp_compress(struct zcomp_strm *zstrm, in zcomp_compress() argument
137 return crypto_comp_compress(zstrm->tfm, in zcomp_compress()
139 zstrm->buffer, dst_len); in zcomp_compress()
142 int zcomp_decompress(struct zcomp_strm *zstrm, in zcomp_decompress() argument
147 return crypto_comp_decompress(zstrm->tfm, in zcomp_decompress()
155 struct zcomp_strm *zstrm; in zcomp_cpu_up_prepare() local
158 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
159 local_lock_init(&zstrm->lock); in zcomp_cpu_up_prepare()
161 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
170 struct zcomp_strm *zstrm; in zcomp_cpu_dead() local
172 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
173 zcomp_strm_free(zstrm); in zcomp_cpu_dead()