summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-03 22:42:22 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-06 19:06:03 -0400
commitd89c8fdf48c7bad5816b9f2e77e8361721f22517 (patch)
tree12d384fffafa1789079b7ed51c4d33d5d10116c0 /src/journal/journal-file.h
parent5e592c66bdf76dfc8445b332f7a5088ca504ee90 (diff)
journal: add LZ4 as optional compressor
Add liblz4 as an optional dependency when requested with --enable-lz4, and use it in preference to liblzma for journal blob and coredump compression. To retain backwards compatibility, XZ is used to decompress old blobs. Things will function correctly only with lz4-119. Based on the benchmarks found on the web, lz4 seems to be the best choice for "quick" compressors atm. For pkg-config status, see http://code.google.com/p/lz4/issues/detail?id=135.
Diffstat (limited to 'src/journal/journal-file.h')
-rw-r--r--src/journal/journal-file.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 50dbe29cc1..b0c28b5e83 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -56,7 +56,8 @@ typedef struct JournalFile {
int flags;
int prot;
bool writable:1;
- bool compress:1;
+ bool compress_xz:1;
+ bool compress_lz4:1;
bool seal:1;
bool tail_entry_monotonic_valid:1;
@@ -153,8 +154,11 @@ static inline bool VALID_EPOCH(uint64_t u) {
#define JOURNAL_HEADER_SEALED(h) \
(!!(le32toh((h)->compatible_flags) & HEADER_COMPATIBLE_SEALED))
-#define JOURNAL_HEADER_COMPRESSED(h) \
- (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED))
+#define JOURNAL_HEADER_COMPRESSED_XZ(h) \
+ (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED_XZ))
+
+#define JOURNAL_HEADER_COMPRESSED_LZ4(h) \
+ (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESSED_LZ4))
int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret);