treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / block / zram / zcomp.h
blob1806475b919df74d6d4f8ce4c611fd486cc0c6c0
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (C) 2014 Sergey Senozhatsky.
4 */
6 #ifndef _ZCOMP_H_
7 #define _ZCOMP_H_
9 struct zcomp_strm {
10 /* compression/decompression buffer */
11 void *buffer;
12 struct crypto_comp *tfm;
15 /* dynamic per-device compression frontend */
16 struct zcomp {
17 struct zcomp_strm * __percpu *stream;
18 const char *name;
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_ */