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
68 i = sysfs_match_string(backends, comp); in zcomp_available_algorithm()
79 return crypto_has_comp(comp, 0, 0) == 1; in zcomp_available_algorithm()
83 ssize_t zcomp_available_show(const char *comp, char *buf) in zcomp_available_show() argument
90 if (!strcmp(comp, backends[i])) { in zcomp_available_show()
104 if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1) in zcomp_available_show()
106 "[%s] ", comp); in zcomp_available_show()
112 struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) in zcomp_stream_get() argument
114 local_lock(&comp->stream->lock); in zcomp_stream_get()
115 return this_cpu_ptr(comp->stream); in zcomp_stream_get()
118 void zcomp_stream_put(struct zcomp *comp) in zcomp_stream_put() argument
120 local_unlock(&comp->stream->lock); in zcomp_stream_put()
131 * comp algorithm `842' pads the compressed length to multiple of 8 in zcomp_compress()
159 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_up_prepare() local
163 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_up_prepare()
166 ret = zcomp_strm_init(zstrm, comp); in zcomp_cpu_up_prepare()
174 struct zcomp *comp = hlist_entry(node, struct zcomp, node); in zcomp_cpu_dead() local
177 zstrm = per_cpu_ptr(comp->stream, cpu); in zcomp_cpu_dead()
182 static int zcomp_init(struct zcomp *comp) in zcomp_init() argument
186 comp->stream = alloc_percpu(struct zcomp_strm); in zcomp_init()
187 if (!comp->stream) in zcomp_init()
190 ret = cpuhp_state_add_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_init()
196 free_percpu(comp->stream); in zcomp_init()
200 void zcomp_destroy(struct zcomp *comp) in zcomp_destroy() argument
202 cpuhp_state_remove_instance(CPUHP_ZCOMP_PREPARE, &comp->node); in zcomp_destroy()
203 free_percpu(comp->stream); in zcomp_destroy()
204 kfree(comp); in zcomp_destroy()
217 struct zcomp *comp; in zcomp_create() local
223 comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL); in zcomp_create()
224 if (!comp) in zcomp_create()
227 comp->name = compress; in zcomp_create()
228 error = zcomp_init(comp); in zcomp_create()
230 kfree(comp); in zcomp_create()
233 return comp; in zcomp_create()