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
71 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
75 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
82 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
96 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
98 "[%s] ", comp); in zcomp_available_show()
104 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
106 local_lock(&comp->stream->lock); in zcomp_stream_get()
107 return this_cpu_ptr(comp->stream); in zcomp_stream_get()
110 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
112 local_unlock(&comp->stream->lock); in zcomp_stream_put()
151 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
155 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
158 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
166 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
169 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
174 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
178 comp->stream = alloc_percpu(struct zcomp_strm); in zcomp_init()
179 if (!comp->stream) in zcomp_init()
182 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
188 free_percpu(comp->stream); in zcomp_init()
192 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
194 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
195 free_percpu(comp->stream); in zcomp_destroy()
196 kfree(comp); in zcomp_destroy()
209 struct zcomp *comp; in zcomp_create() local
220 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
221 if (!comp) in zcomp_create()
224 comp->name = compress; in zcomp_create()
225 error = zcomp_init(comp); in zcomp_create()
227 kfree(comp); in zcomp_create()
230 return comp; in zcomp_create()