summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwdenk <wdenk>2005-05-05 09:51:44 +0000
committerwdenk <wdenk>2005-05-05 09:51:44 +0000
commit412babe304b948e1e3a909f8d2eb091b83f700d5 (patch)
treefde6b10727916e1ec0684bd6a9fa863785ed2169
parent60fc6cbbb7d49895e3ee552539f5375f8f1303b5 (diff)
It's better to handle LZO and LZARI compression mdoes for JFFS2 withLABEL_2005_05_05_1920
a single #define.
-rw-r--r--CHANGELOG5
-rw-r--r--fs/jffs2/compr_lzari.c4
-rw-r--r--fs/jffs2/compr_lzo.c4
-rw-r--r--fs/jffs2/jffs2_1pass.c14
-rw-r--r--include/jffs2/jffs2.h14
5 files changed, 20 insertions, 21 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b10107a3951..828245c4f55 100644
--- 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.
diff --git a/fs/jffs2/compr_lzari.c b/fs/jffs2/compr_lzari.c
index a6a708bcd64..828b6e5515b 100644
--- a/fs/jffs2/compr_lzari.c
+++ b/fs/jffs2/compr_lzari.c
@@ -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)) */
diff --git a/fs/jffs2/compr_lzo.c b/fs/jffs2/compr_lzo.c
index e97c18f51e4..b6c590ac8f3 100644
--- a/fs/jffs2/compr_lzo.c
+++ b/fs/jffs2/compr_lzo.c
@@ -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)) */
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index a025116b7f0..c3553cb4ae4 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -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 */
diff --git a/include/jffs2/jffs2.h b/include/jffs2/jffs2.h
index 2fec488d1af..0197dfd86c3 100644
--- a/include/jffs2/jffs2.h
+++ b/include/jffs2/jffs2.h
@@ -65,10 +65,14 @@
#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);