From 412babe304b948e1e3a909f8d2eb091b83f700d5 Mon Sep 17 00:00:00 2001 From: wdenk Date: Thu, 5 May 2005 09:51:44 +0000 Subject: [PATCH] It's better to handle LZO and LZARI compression mdoes for JFFS2 with a single #define. --- CHANGELOG | 5 +++-- fs/jffs2/compr_lzari.c | 4 ++-- fs/jffs2/compr_lzo.c | 4 ++-- fs/jffs2/jffs2_1pass.c | 14 +++++--------- include/jffs2/jffs2.h | 14 ++++++++------ 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b10107a395..828245c4f5 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 a6a708bcd6..828b6e5515 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 -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZARI)) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) #include #include @@ -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 e97c18f51e..b6c590ac8f 100644 --- a/fs/jffs2/compr_lzo.c +++ b/fs/jffs2/compr_lzo.c @@ -67,7 +67,7 @@ #include -#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO)) +#if ((CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)) #include #include @@ -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 a025116b7f..c3553cb4ae 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 2fec488d1a..0197dfd86c 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); -- 2.39.5