summaryrefslogtreecommitdiffstats
path: root/src/journal/journal-def.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-06-01 23:26:55 +0200
committerLennart Poettering <lennart@poettering.net>2020-06-25 15:02:18 +0200
commit8653185a9eda17d9b0781cb19cb4d3c6ce28d264 (patch)
tree33551f38e3b8b61f223c15342d04644bfe1e99d7 /src/journal/journal-def.h
parentjournal-file: when individual hash chains grow too large, rotate (diff)
downloadsystemd-8653185a9eda17d9b0781cb19cb4d3c6ce28d264.tar.xz
systemd-8653185a9eda17d9b0781cb19cb4d3c6ce28d264.zip
journal: support zstd compression for large objects in journal files
Diffstat (limited to 'src/journal/journal-def.h')
-rw-r--r--src/journal/journal-def.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h
index 2cb6c21392..cbdc92b2d0 100644
--- a/src/journal/journal-def.h
+++ b/src/journal/journal-def.h
@@ -46,11 +46,11 @@ typedef enum ObjectType {
enum {
OBJECT_COMPRESSED_XZ = 1 << 0,
OBJECT_COMPRESSED_LZ4 = 1 << 1,
- OBJECT_COMPRESSION_MASK = (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4),
+ OBJECT_COMPRESSED_ZSTD = 1 << 2,
+ OBJECT_COMPRESSION_MASK = (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4 | OBJECT_COMPRESSED_ZSTD),
_OBJECT_COMPRESSED_MAX = OBJECT_COMPRESSION_MASK,
};
-
struct ObjectHeader {
uint8_t type;
uint8_t flags;
@@ -152,19 +152,29 @@ enum {
HEADER_INCOMPATIBLE_COMPRESSED_XZ = 1 << 0,
HEADER_INCOMPATIBLE_COMPRESSED_LZ4 = 1 << 1,
HEADER_INCOMPATIBLE_KEYED_HASH = 1 << 2,
+ HEADER_INCOMPATIBLE_COMPRESSED_ZSTD = 1 << 3,
};
-#define HEADER_INCOMPATIBLE_ANY \
- (HEADER_INCOMPATIBLE_COMPRESSED_XZ| \
- HEADER_INCOMPATIBLE_COMPRESSED_LZ4| \
- HEADER_INCOMPATIBLE_KEYED_HASH)
+#define HEADER_INCOMPATIBLE_ANY \
+ (HEADER_INCOMPATIBLE_COMPRESSED_XZ | \
+ HEADER_INCOMPATIBLE_COMPRESSED_LZ4 | \
+ HEADER_INCOMPATIBLE_KEYED_HASH | \
+ HEADER_INCOMPATIBLE_COMPRESSED_ZSTD)
-#if HAVE_XZ && HAVE_LZ4
+#if HAVE_XZ && HAVE_LZ4 && HAVE_ZSTD
# define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_ANY
+#elif HAVE_XZ && HAVE_LZ4
+# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_LZ4|HEADER_INCOMPATIBLE_KEYED_HASH)
+#elif HAVE_XZ && HAVE_ZSTD
+# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_ZSTD|HEADER_INCOMPATIBLE_KEYED_HASH)
+#elif HAVE_LZ4 && HAVE_ZSTD
+# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_LZ4|HEADER_INCOMPATIBLE_COMPRESSED_ZSTD|HEADER_INCOMPATIBLE_KEYED_HASH)
#elif HAVE_XZ
# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_KEYED_HASH)
#elif HAVE_LZ4
# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_LZ4|HEADER_INCOMPATIBLE_KEYED_HASH)
+#elif HAVE_ZSTD
+# define HEADER_INCOMPATIBLE_SUPPORTED (HEADER_INCOMPATIBLE_COMPRESSED_ZSTD|HEADER_INCOMPATIBLE_KEYED_HASH)
#else
# define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_KEYED_HASH
#endif