Lines Matching refs:comp
47 static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp) in zcomp_strm_alloc() argument
53 zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0); in zcomp_strm_alloc()
66 bool zcomp_available_algorithm(const char *comp) in zcomp_available_algorithm() argument
70 i = __sysfs_match_string(backends, -1, comp); in zcomp_available_algorithm()
81 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
85 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
92 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
106 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
108 "[%s] ", comp); in zcomp_available_show()
114 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
116 return *get_cpu_ptr(comp->stream); in zcomp_stream_get()
119 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
121 put_cpu_ptr(comp->stream); in zcomp_stream_put()
160 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
163 if (WARN_ON(*per_cpu_ptr(comp->stream, cpu))) in zcomp_cpu_up_prepare()
166 zstrm = zcomp_strm_alloc(comp); in zcomp_cpu_up_prepare()
171 *per_cpu_ptr(comp->stream, cpu) = zstrm; in zcomp_cpu_up_prepare()
177 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
180 zstrm = *per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
183 *per_cpu_ptr(comp->stream, cpu) = NULL; in zcomp_cpu_dead()
187 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
191 comp->stream = alloc_percpu(struct zcomp_strm *); in zcomp_init()
192 if (!comp->stream) in zcomp_init()
195 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
201 free_percpu(comp->stream); in zcomp_init()
205 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
207 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
208 free_percpu(comp->stream); in zcomp_destroy()
209 kfree(comp); in zcomp_destroy()
222 struct zcomp *comp; in zcomp_create() local
228 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
229 if (!comp) in zcomp_create()
232 comp->name = compress; in zcomp_create()
233 error = zcomp_init(comp); in zcomp_create()
235 kfree(comp); in zcomp_create()
238 return comp; in zcomp_create()