1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2014 Sergey Senozhatsky.
10 /* compression/decompression buffer */
12 struct crypto_comp
*tfm
;
15 /* dynamic per-device compression frontend */
17 struct zcomp_strm
* __percpu
*stream
;
19 struct hlist_node node
;
22 int zcomp_cpu_up_prepare(unsigned int cpu
, struct hlist_node
*node
);
23 int zcomp_cpu_dead(unsigned int cpu
, struct hlist_node
*node
);
24 ssize_t
zcomp_available_show(const char *comp
, char *buf
);
25 bool zcomp_available_algorithm(const char *comp
);
27 struct zcomp
*zcomp_create(const char *comp
);
28 void zcomp_destroy(struct zcomp
*comp
);
30 struct zcomp_strm
*zcomp_stream_get(struct zcomp
*comp
);
31 void zcomp_stream_put(struct zcomp
*comp
);
33 int zcomp_compress(struct zcomp_strm
*zstrm
,
34 const void *src
, unsigned int *dst_len
);
36 int zcomp_decompress(struct zcomp_strm
*zstrm
,
37 const void *src
, unsigned int src_len
, void *dst
);
39 bool zcomp_set_max_streams(struct zcomp
*comp
, int num_strm
);
40 #endif /* _ZCOMP_H_ */