summaryrefslogtreecommitdiff
path: root/src/journal/compress.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-06-25 20:53:40 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-06-26 01:41:04 -0400
commit347272731e15d3c4a70fad7ccd7185e8e8059d01 (patch)
tree11c1d96506fab4ed3240a4f432763e774fd03f6e /src/journal/compress.c
parentcfd652ed617282b06ccbdedb7adc6963b901dde7 (diff)
coredump: make compression configurable
Add Compression={none,xz} and CompressionLevel=0-9 settings. Defaults are xz/6. Compression=filesystem may be added later. I picked "xz" for the compression "type", since we might want to add different compressors later on. XZ is fairly memory and CPU intensive, and embedded users will likely want to use LZO or some other lightweight compression mechanism.
Diffstat (limited to 'src/journal/compress.c')
-rw-r--r--src/journal/compress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/compress.c b/src/journal/compress.c
index f36c430801..1fc62ead2a 100644
--- a/src/journal/compress.c
+++ b/src/journal/compress.c
@@ -203,7 +203,7 @@ fail:
return b;
}
-int compress_stream(int fdf, int fdt, off_t max_bytes) {
+int compress_stream(int fdf, int fdt, uint32_t preset, off_t max_bytes) {
_cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT;
lzma_ret ret;
@@ -213,7 +213,7 @@ int compress_stream(int fdf, int fdt, off_t max_bytes) {
assert(fdf >= 0);
assert(fdt >= 0);
- ret = lzma_easy_encoder(&s, LZMA_PRESET_DEFAULT, LZMA_CHECK_CRC64);
+ ret = lzma_easy_encoder(&s, preset, LZMA_CHECK_CRC64);
if (ret != LZMA_OK) {
log_error("Failed to initialize XZ encoder: code %d", ret);
return -EINVAL;