]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/block/zram/zcomp.h
zram: delete custom lzo/lz4
[mirror_ubuntu-bionic-kernel.git] / drivers / block / zram / zcomp.h
CommitLineData
e7e1ef43
SS
1/*
2 * Copyright (C) 2014 Sergey Senozhatsky.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#ifndef _ZCOMP_H_
11#define _ZCOMP_H_
12
e7e1ef43
SS
13struct zcomp_strm {
14 /* compression/decompression buffer */
15 void *buffer;
ebaf9ab5 16 struct crypto_comp *tfm;
e7e1ef43
SS
17};
18
e7e1ef43
SS
19/* dynamic per-device compression frontend */
20struct zcomp {
da9556a2 21 struct zcomp_strm * __percpu *stream;
da9556a2 22 struct notifier_block notifier;
ebaf9ab5
SS
23
24 const char *name;
e7e1ef43
SS
25};
26
e46b8a03 27ssize_t zcomp_available_show(const char *comp, char *buf);
d93435c3 28bool zcomp_available_algorithm(const char *comp);
e46b8a03 29
da9556a2 30struct zcomp *zcomp_create(const char *comp);
e7e1ef43
SS
31void zcomp_destroy(struct zcomp *comp);
32
2aea8493
SS
33struct zcomp_strm *zcomp_stream_get(struct zcomp *comp);
34void zcomp_stream_put(struct zcomp *comp);
e7e1ef43 35
ebaf9ab5
SS
36int zcomp_compress(struct zcomp_strm *zstrm,
37 const void *src, unsigned int *dst_len);
e7e1ef43 38
ebaf9ab5
SS
39int zcomp_decompress(struct zcomp_strm *zstrm,
40 const void *src, unsigned int src_len, void *dst);
fe8eb122 41
60a726e3 42bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
e7e1ef43 43#endif /* _ZCOMP_H_ */