diff options
author | Mikhail Zaslonko <zaslonko@linux.ibm.com> | 2023-01-26 16:14:26 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-03 09:50:09 +0300 |
commit | 9fec9f8ea51c782d58a8b86f8e868fc06c782386 (patch) | |
tree | 12df6a553a6eb2bdc0d61861462ae254eb6f44eb /lib/zlib_dfltcc/dfltcc_inflate.c | |
parent | cbf125408d1ca141cc1c3f8376e091e3cdde2cb2 (diff) | |
download | linux-9fec9f8ea51c782d58a8b86f8e868fc06c782386.tar.xz |
lib/zlib: Split deflate and inflate states for DFLTCC
Currently deflate and inflate both use a common state struct. There are
several variables in this struct that we don't need for inflate, and
more may be coming in the future. Therefore split them in two separate
structs.
Apart from that, introduce separate headers for dfltcc_deflate and
dfltcc_inflate.
This commit is based on:
https://github.com/zlib-ng/zlib-ng/commit/c592b1b
Link: https://lkml.kernel.org/r/20230126131428.1222214-7-zaslonko@linux.ibm.com
Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/zlib_dfltcc/dfltcc_inflate.c')
-rw-r--r-- | lib/zlib_dfltcc/dfltcc_inflate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/zlib_dfltcc/dfltcc_inflate.c b/lib/zlib_dfltcc/dfltcc_inflate.c index fb60b5a6a1cb..a16f416c8811 100644 --- a/lib/zlib_dfltcc/dfltcc_inflate.c +++ b/lib/zlib_dfltcc/dfltcc_inflate.c @@ -2,7 +2,7 @@ #include "../zlib_inflate/inflate.h" #include "dfltcc_util.h" -#include "dfltcc.h" +#include "dfltcc_inflate.h" #include <asm/setup.h> #include <linux/export.h> #include <linux/zutil.h> @@ -32,6 +32,14 @@ int dfltcc_can_inflate( } EXPORT_SYMBOL(dfltcc_can_inflate); +void dfltcc_reset_inflate_state(z_streamp strm) { + struct inflate_state *state = (struct inflate_state *)strm->state; + struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state); + + dfltcc_reset_state(dfltcc_state); +} +EXPORT_SYMBOL(dfltcc_reset_inflate_state); + static int dfltcc_was_inflate_used( z_streamp strm ) |