40 #ifdef CONFIG_UBIFS_FS_LZO
45 .comp_mutex = &lzo_mutex,
56 #ifdef CONFIG_UBIFS_FS_ZLIB
62 .comp_mutex = &deflate_mutex,
63 .decomp_mutex = &inflate_mutex,
65 .capi_name =
"deflate",
110 err = crypto_comp_compress(compr->
cc, in_buf, in_len, out_buf,
111 (
unsigned int *)out_len);
115 ubifs_warn(
"cannot compress %d bytes, compressor %s, error %d, leave data uncompressed",
116 in_len, compr->
name, err);
130 memcpy(out_buf, in_buf, in_len);
154 ubifs_err(
"invalid compression type %d", compr_type);
166 memcpy(out_buf, in_buf, in_len);
173 err = crypto_comp_decompress(compr->
cc, in_buf, in_len, out_buf,
174 (
unsigned int *)out_len);
178 ubifs_err(
"cannot decompress %d bytes, compressor %s, error %d",
179 in_len, compr->
name, err);
194 compr->
cc = crypto_alloc_comp(compr->
capi_name, 0, 0);
195 if (IS_ERR(compr->
cc)) {
196 ubifs_err(
"cannot initialize compressor %s, error %ld",
197 compr->
name, PTR_ERR(compr->
cc));
198 return PTR_ERR(compr->
cc);
213 crypto_free_comp(compr->
cc);
227 err = compr_init(&lzo_compr);
231 err = compr_init(&zlib_compr);
239 compr_exit(&lzo_compr);
248 compr_exit(&lzo_compr);
249 compr_exit(&zlib_compr);