mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
2874c5fd28
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2014 Sergey Senozhatsky.
|
|
*/
|
|
|
|
#ifndef _ZCOMP_H_
|
|
#define _ZCOMP_H_
|
|
|
|
struct zcomp_strm {
|
|
/* compression/decompression buffer */
|
|
void *buffer;
|
|
struct crypto_comp *tfm;
|
|
};
|
|
|
|
/* dynamic per-device compression frontend */
|
|
struct zcomp {
|
|
struct zcomp_strm * __percpu *stream;
|
|
const char *name;
|
|
struct hlist_node node;
|
|
};
|
|
|
|
int zcomp_cpu_up_prepare(unsigned int cpu, struct hlist_node *node);
|
|
int zcomp_cpu_dead(unsigned int cpu, struct hlist_node *node);
|
|
ssize_t zcomp_available_show(const char *comp, char *buf);
|
|
bool zcomp_available_algorithm(const char *comp);
|
|
|
|
struct zcomp *zcomp_create(const char *comp);
|
|
void zcomp_destroy(struct zcomp *comp);
|
|
|
|
struct zcomp_strm *zcomp_stream_get(struct zcomp *comp);
|
|
void zcomp_stream_put(struct zcomp *comp);
|
|
|
|
int zcomp_compress(struct zcomp_strm *zstrm,
|
|
const void *src, unsigned int *dst_len);
|
|
|
|
int zcomp_decompress(struct zcomp_strm *zstrm,
|
|
const void *src, unsigned int src_len, void *dst);
|
|
|
|
bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
|
|
#endif /* _ZCOMP_H_ */
|