Lines Matching refs:zstrm
36 static void zcomp_strm_free(struct zcomp_strm *zstrm) in zcomp_strm_free() argument
38 if (!IS_ERR_OR_NULL(zstrm->tfm)) in zcomp_strm_free()
39 crypto_free_comp(zstrm->tfm); in zcomp_strm_free()
40 free_pages((unsigned long)zstrm->buffer, 1); in zcomp_strm_free()
41 zstrm->tfm = NULL; in zcomp_strm_free()
42 zstrm->buffer = NULL; in zcomp_strm_free()
49 static int zcomp_strm_init(struct zcomp_strm *zstrm, struct zcomp *comp) in zcomp_strm_init() argument
51 zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0); in zcomp_strm_init()
56 zstrm->buffer = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1); in zcomp_strm_init()
57 if (IS_ERR_OR_NULL(zstrm->tfm) || !zstrm->buffer) { in zcomp_strm_init()
58 zcomp_strm_free(zstrm); in zcomp_strm_init()
117 int zcomp_compress(struct zcomp_strm *zstrm, in zcomp_compress() argument
136 return crypto_comp_compress(zstrm->tfm, in zcomp_compress()
138 zstrm->buffer, dst_len); in zcomp_compress()
141 int zcomp_decompress(struct zcomp_strm *zstrm, in zcomp_decompress() argument
146 return crypto_comp_decompress(zstrm->tfm, in zcomp_decompress()
154 struct zcomp_strm *zstrm; in zcomp_cpu_up_prepare() local
157 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
158 local_lock_init(&zstrm->lock); in zcomp_cpu_up_prepare()
160 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
169 struct zcomp_strm *zstrm; in zcomp_cpu_dead() local
171 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
172 zcomp_strm_free(zstrm); in zcomp_cpu_dead()