diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2025-01-14 21:04:54 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-01-24 22:47:28 -0800 |
commit | f0ef073e213a3a1a494b6f55a76ce1242600a453 (patch) | |
tree | 3ac9d0e165ca158cac7931e3fd0037a4489d1491 /lib | |
parent | 13fd5cf37456620b57106dbfa89c5aad5f195343 (diff) |
include/linux/lz4.h: add some missing macros
Currently, LZ4_DISTANCE_MAX and LZ4_DECOMPRESS_INPLACE_MARGIN are
defined in the erofs subsystem for LZ4 in-place decompression, which is
somewhat unsuitable since they should belong to the LZ4 itself and
may change with future LZ4 codebase updates.
Move them to include/linux/lz4.h to match the upstream LZ4 library [1].
No logic changes.
[1] https://github.com/lz4/lz4/blob/v1.10.0/lib/lz4.h#L670
Link: https://lkml.kernel.org/r/20250114130454.1191150-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Chao Yu <chao@kernel.org>
Cc: Yue Hu <zbestahu@gmail.com>
Cc; Jeffle Xu <jefflexu@linux.alibaba.com>
Cc: Sandeep Dhavale <dhavale@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4/lz4_compress.c | 1 | ||||
-rw-r--r-- | lib/lz4/lz4_decompress.c | 1 | ||||
-rw-r--r-- | lib/lz4/lz4defs.h | 4 | ||||
-rw-r--r-- | lib/lz4/lz4hc_compress.c | 1 |
4 files changed, 2 insertions, 5 deletions
diff --git a/lib/lz4/lz4_compress.c b/lib/lz4/lz4_compress.c index b0bbeeb74b9e..2a397bb2c661 100644 --- a/lib/lz4/lz4_compress.c +++ b/lib/lz4/lz4_compress.c @@ -33,7 +33,6 @@ /*-************************************ * Dependencies **************************************/ -#include <linux/lz4.h> #include "lz4defs.h" #include <linux/module.h> #include <linux/kernel.h> diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c index 0e31e6da5ce7..3a2cd9acada4 100644 --- a/lib/lz4/lz4_decompress.c +++ b/lib/lz4/lz4_decompress.c @@ -33,7 +33,6 @@ /*-************************************ * Dependencies **************************************/ -#include <linux/lz4.h> #include "lz4defs.h" #include <linux/init.h> #include <linux/module.h> diff --git a/lib/lz4/lz4defs.h b/lib/lz4/lz4defs.h index cb358d6bde5a..17277ec16919 100644 --- a/lib/lz4/lz4defs.h +++ b/lib/lz4/lz4defs.h @@ -39,6 +39,7 @@ #include <linux/bitops.h> #include <linux/string.h> /* memset, memcpy */ +#include <linux/lz4.h> #define FORCE_INLINE __always_inline @@ -92,8 +93,7 @@ typedef uintptr_t uptrval; #define MB (1 << 20) #define GB (1U << 30) -#define MAXD_LOG 16 -#define MAX_DISTANCE ((1 << MAXD_LOG) - 1) +#define MAX_DISTANCE LZ4_DISTANCE_MAX #define STEPSIZE sizeof(size_t) #define ML_BITS 4 diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c index bc45594ad2a8..91936dc3d14b 100644 --- a/lib/lz4/lz4hc_compress.c +++ b/lib/lz4/lz4hc_compress.c @@ -34,7 +34,6 @@ /*-************************************ * Dependencies **************************************/ -#include <linux/lz4.h> #include "lz4defs.h" #include <linux/module.h> #include <linux/kernel.h> |