Lines Matching refs:comp

50 static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)  in zcomp_strm_alloc()  argument
56 zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0); in zcomp_strm_alloc()
69 bool zcomp_available_algorithm(const char *comp) in zcomp_available_algorithm() argument
73 i = __sysfs_match_string(backends, -1, comp); in zcomp_available_algorithm()
84 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
88 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
95 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
109 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
111 "[%s] ", comp); in zcomp_available_show()
117 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
119 return *get_cpu_ptr(comp->stream); in zcomp_stream_get()
122 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
124 put_cpu_ptr(comp->stream); in zcomp_stream_put()
163 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
166 if (WARN_ON(*per_cpu_ptr(comp->stream, cpu))) in zcomp_cpu_up_prepare()
169 zstrm = zcomp_strm_alloc(comp); in zcomp_cpu_up_prepare()
174 *per_cpu_ptr(comp->stream, cpu) = zstrm; in zcomp_cpu_up_prepare()
180 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
183 zstrm = *per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
186 *per_cpu_ptr(comp->stream, cpu) = NULL; in zcomp_cpu_dead()
190 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
194 comp->stream = alloc_percpu(struct zcomp_strm *); in zcomp_init()
195 if (!comp->stream) in zcomp_init()
198 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
204 free_percpu(comp->stream); in zcomp_init()
208 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
210 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
211 free_percpu(comp->stream); in zcomp_destroy()
212 kfree(comp); in zcomp_destroy()
225 struct zcomp *comp; in zcomp_create() local
231 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
232 if (!comp) in zcomp_create()
235 comp->name = compress; in zcomp_create()
236 error = zcomp_init(comp); in zcomp_create()
238 kfree(comp); in zcomp_create()
241 return comp; in zcomp_create()