Blob Blame Raw
From 476a6ff39699561372717fe51a86ce81c27b8b22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 24 Jun 2014 21:24:46 -0400
Subject: [PATCH] journal/compress: add stream compression/decompression
 functions

(cherry picked from commit 355b59e252c9910e44a1ad95c045ba8db58a4f6a)

Conflicts:
	src/journal/test-compress.c
	src/shared/copy.c

Actually keep only compress_blob changes.

(cherry picked from commit 63f877db164c15752c40716b47fc2d623cdb851d)
---
 src/journal/compress.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/journal/compress.c b/src/journal/compress.c
index cafe8f4f54..a83dcea3c7 100644
--- a/src/journal/compress.c
+++ b/src/journal/compress.c
@@ -24,8 +24,8 @@
 #include <string.h>
 #include <lzma.h>
 
-#include "macro.h"
 #include "compress.h"
+#include "macro.h"
 
 bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_size) {
         lzma_ret ret;
@@ -40,12 +40,12 @@ bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_
          * compressed result is longer than the original */
 
         ret = lzma_easy_buffer_encode(LZMA_PRESET_DEFAULT, LZMA_CHECK_NONE, NULL,
-                                      src, src_size, dst, &out_pos, *dst_size);
+                                      src, src_size, dst, &out_pos, src_size);
         if (ret != LZMA_OK)
                 return false;
 
         /* Is it actually shorter? */
-        if (out_pos == *dst_size)
+        if (out_pos == src_size)
                 return false;
 
         *dst_size = out_pos;