Lines Matching refs:comp

47 static int zcomp_strm_init(struct zcomp_strm *zstrm, struct zcomp *comp)  in zcomp_strm_init()  argument
49 zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0); in zcomp_strm_init()
62 bool zcomp_available_algorithm(const char *comp) in zcomp_available_algorithm() argument
66 i = sysfs_match_string(backends, comp); in zcomp_available_algorithm()
77 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
81 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
88 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
102 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
104 "[%s] ", comp); in zcomp_available_show()
110 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
112 local_lock(&comp->stream->lock); in zcomp_stream_get()
113 return this_cpu_ptr(comp->stream); in zcomp_stream_get()
116 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
118 local_unlock(&comp->stream->lock); in zcomp_stream_put()
157 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
161 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
164 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
172 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
175 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
180 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
184 comp->stream = alloc_percpu(struct zcomp_strm); in zcomp_init()
185 if (!comp->stream) in zcomp_init()
188 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
194 free_percpu(comp->stream); in zcomp_init()
198 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
200 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
201 free_percpu(comp->stream); in zcomp_destroy()
202 kfree(comp); in zcomp_destroy()
215 struct zcomp *comp; in zcomp_create() local
221 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
222 if (!comp) in zcomp_create()
225 comp->name = compress; in zcomp_create()
226 error = zcomp_init(comp); in zcomp_create()
228 kfree(comp); in zcomp_create()
231 return comp; in zcomp_create()