Lines Matching full:comp
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()
64 bool zcomp_available_algorithm(const char *comp) in zcomp_available_algorithm() argument
73 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
77 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
84 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
98 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
100 "[%s] ", comp); in zcomp_available_show()
106 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
108 local_lock(&comp->stream->lock); in zcomp_stream_get()
109 return this_cpu_ptr(comp->stream); in zcomp_stream_get()
112 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
114 local_unlock(&comp->stream->lock); in zcomp_stream_put()
125 * comp algorithm `842' pads the compressed length to multiple of 8 in zcomp_compress()
153 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
157 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
160 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
168 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
171 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
176 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
180 comp->stream = alloc_percpu(struct zcomp_strm); in zcomp_init()
181 if (!comp->stream) in zcomp_init()
184 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
190 free_percpu(comp->stream); in zcomp_init()
194 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
196 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
197 free_percpu(comp->stream); in zcomp_destroy()
198 kfree(comp); in zcomp_destroy()
211 struct zcomp *comp; in zcomp_create() local
222 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
223 if (!comp) in zcomp_create()
226 comp->name = alg; in zcomp_create()
227 error = zcomp_init(comp); in zcomp_create()
229 kfree(comp); in zcomp_create()
232 return comp; in zcomp_create()