]> www.infradead.org Git - mtd-utils.git/commitdiff
Fix favor LZO implementation
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 22 Oct 2008 15:12:14 +0000 (18:12 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 22 Oct 2008 15:12:14 +0000 (18:12 +0300)
Use c->favor_percent, not c->favor_lzo.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
mkfs.ubifs/compr.c
mkfs.ubifs/mkfs.ubifs.c
mkfs.ubifs/mkfs.ubifs.h

index 8ed2904f9f94c5c7c17b6cdaebce380bc853d7c6..e378c5de3be758de2229292cafb67db2cf31339f 100644 (file)
@@ -34,6 +34,7 @@
 
 static void *lzo_mem;
 static unsigned long long errcnt = 0;
+static struct ubifs_info *c = &info_;
 
 #define DEFLATE_DEF_LEVEL     Z_DEFAULT_COMPRESSION
 #define DEFLATE_DEF_WINBITS   11
@@ -133,7 +134,7 @@ static int favor_lzo_compress(void *in_buf, size_t in_len, void *out_buf,
 
                percent = (double)zlib_len / (double)lzo_len;
                percent *= 100;
-               if (percent > 100 - c->favor_lzo)
+               if (percent > 100 - c->favor_percent)
                        goto select_lzo;
                goto select_zlib;
        }
index 8394df98af5d381722803edae91a0550ea2456f7..f8b4636d54ef7ebc6cd1200efb5a6490b8be3c6b 100644 (file)
@@ -93,8 +93,8 @@ struct inum_mapping {
  * Because we copy functions from the kernel, we use a subset of the UBIFS
  * file-system description object struct ubifs_info.
  */
-static struct ubifs_info info_;
-struct ubifs_info *c = &info_;
+struct ubifs_info info_;
+static struct ubifs_info *c = &info_;
 
 /* Debug levels are: 0 (none), 1 (statistics), 2 (files) ,3 (more details) */
 int debug_level;
index 705a9f9ab99c3aa6924af6cacffd033a8731f808..3c0d79cf202635554c2c42d6b13fb7aa82694c44 100644 (file)
@@ -124,7 +124,7 @@ struct name_htbl_element {
        dev_t dev;
 };
 
-extern struct ubifs_info *c;
+extern struct ubifs_info info_;
 
 struct hashtable_itr;