Commit 412babe3 authored by wdenk's avatar wdenk

It's better to handle LZO and LZARI compression mdoes for JFFS2 with

a single #define.
parent 60fc6cbb
......@@ -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.
......
......@@ -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)) */
......@@ -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)) */
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment