]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ubifs/compress.c
UBIFS: slight compression optimization
[linux-2.6-omap-h63xx.git] / fs / ubifs / compress.c
index a0ada596b17c4a5d9180b515e5fd7e524b72a642..6414d50780e14cb1c4edbb9d4f41dc4182844b8b 100644 (file)
@@ -119,10 +119,10 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
        }
 
        /*
-        * Presently, we just require that compression results in less data,
-        * rather than any defined minimum compression ratio or amount.
+        * If the data compressed only slightly, it is better to leave it
+        * uncompressed to improve read speed.
         */
-       if (ALIGN(*out_len, 8) >= ALIGN(in_len, 8))
+       if (in_len - *out_len < UBIFS_MIN_COMPRESS_DIFF)
                goto no_compr;
 
        return;