]> git.sur5r.net Git - u-boot/commitdiff
It's better to handle LZO and LZARI compression mdoes for JFFS2 with LABEL_2005_05_05_1920
authorwdenk <wdenk>
Thu, 5 May 2005 09:51:44 +0000 (09:51 +0000)
committerwdenk <wdenk>
Thu, 5 May 2005 09:51:44 +0000 (09:51 +0000)
a single #define.

CHANGELOG
fs/jffs2/compr_lzari.c
fs/jffs2/compr_lzo.c
fs/jffs2/jffs2_1pass.c
include/jffs2/jffs2.h

index b10107a3951e535b0b51325a9231d19f4b47e326..828245c4f55a5bc3e052512981fb5e1eaa992a70 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,8 +6,9 @@ Changes for U-Boot 1.1.3:
   size.
 
 * Major upate of JFFS2 code; now in sync with snapshot of MTD CVS of
-  March 13, 2005); new configuration options CONFIG_JFFS2_LZO and
-  CONFIG_JFFS2_LZARI are added. Both are undefined by default.
+  March 13, 2005); new configuration option CONFIG_JFFS2_LZO_LZARI
+  added to support LZO and LZARI compression modes (undefined by
+  default).
 
 * Fix problem with symbolic links in JFFS2 code.
 
index a6a708bcd644f2f84f6b093a366619b90b9e6f06..828b6e5515b12a2bd06bd9b1ab1c44025df51690 100644 (file)
@@ -50,7 +50,7 @@ All rights reserved. Permission granted for non-commercial use.
 
 
 #include <config.h>
-#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZARI))
+#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI))
 
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
@@ -259,4 +259,4 @@ int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
 {
     return Decode(data_in, cpage_out, srclen, destlen);
 }
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZARI)) */
+#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) */
index e97c18f51e4aeb3ab12450a6127e52ac06bba598..b6c590ac8f3a75615548633b2bfabd8255b86a37 100644 (file)
@@ -67,7 +67,7 @@
 
 
 #include <config.h>
-#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO))
+#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI))
 
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
@@ -402,4 +402,4 @@ int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out,
        return lzo1x_decompress (data_in, srclen, cpage_out, &outlen, NULL);
 }
 
-#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO)) */
+#endif /* ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) */
index a025116b7f0fc8ecd7db85fdd372e0b5bc02ae6a..c3553cb4ae438e0533e5ccb4a6ac5b9748700a00 100644 (file)
@@ -275,10 +275,8 @@ static char *compr_names[] = {
        "COPY",
        "DYNRUBIN",
        "ZLIB",
-#if defined(CONFIG_JFFS2_LZO)
+#if defined(CONFIG_JFFS2_LZO_LZARI)
        "LZO",
-#endif
-#if defined(CONFIG_JFFS2_LZARI)
        "LZARI",
 #endif
 };
@@ -589,15 +587,13 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
                                case JFFS2_COMPR_ZLIB:
                                        ret = zlib_decompress(src, lDest, jNode->csize, jNode->dsize);
                                        break;
-#if defined(CONFIG_JFFS2_LZARI)
-                               case JFFS2_COMPR_LZARI:
-                                       ret = lzari_decompress(src, lDest, jNode->csize, jNode->dsize);
-                                       break;
-#endif
-#if defined(CONFIG_JFFS2_LZO)
+#if defined(CONFIG_JFFS2_LZO_LZARI)
                                case JFFS2_COMPR_LZO:
                                        ret = lzo_decompress(src, lDest, jNode->csize, jNode->dsize);
                                        break;
+                               case JFFS2_COMPR_LZARI:
+                                       ret = lzari_decompress(src, lDest, jNode->csize, jNode->dsize);
+                                       break;
 #endif
                                default:
                                        /* unknown */
index 2fec488d1af956302b47fc642289221c290fa067..0197dfd86c334a284128571f6edfeb63f99fb9ec 100644 (file)
 #define JFFS2_COMPR_COPY       0x04
 #define JFFS2_COMPR_DYNRUBIN   0x05
 #define JFFS2_COMPR_ZLIB       0x06
+#if defined(CONFIG_JFFS2_LZO_LZARI)
 #define JFFS2_COMPR_LZO                0x07
 #define JFFS2_COMPR_LZARI      0x08
 #define JFFS2_NUM_COMPR                9
-
+#else
+#define JFFS2_NUM_COMPR                7
+#endif
 /* Compatibility flags. */
 #define JFFS2_COMPAT_MASK 0xc000      /* What do to if an unknown nodetype is found */
 #define JFFS2_NODE_ACCURATE 0x2000
@@ -203,13 +207,11 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
                unsigned long sourcelen, unsigned long dstlen);
 long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
                __u32 srclen, __u32 destlen);
-#if defined(CONFIG_JFFS2_LZARI)
-int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
-               u32 srclen, u32 destlen);
-#endif
-#if defined(CONFIG_JFFS2_LZO)
+#if defined(CONFIG_JFFS2_LZO_LZARI)
 int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out,
                u32 srclen, u32 destlen);
+int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
+               u32 srclen, u32 destlen);
 #endif
 
 char *mkmodestr(unsigned long mode, char *str);