Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-06-01 Thread Satyam Sharma
Hi Daniel, On 6/1/07, Daniel Hazelton <[EMAIL PROTECTED]> wrote: On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: > On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: > > [1] For your reference, here is the user code in question: > > ... > > >if (srclen > 2 && !(data_in[1] &

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-06-01 Thread Satyam Sharma
Hi Daniel, On 6/1/07, Daniel Hazelton [EMAIL PROTECTED] wrote: On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: [1] For your reference, here is the user code in question: ... if (srclen 2 !(data_in[1] PRESET_DICT)

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-31 Thread Daniel Hazelton
On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: > On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: > > [1] For your reference, here is the user code in question: > > ... > > >if (srclen > 2 && !(data_in[1] & PRESET_DICT) && > > ((data_in[0] & 0x0f) == Z_DEFLATED) && > >

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-31 Thread Daniel Hazelton
On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: [1] For your reference, here is the user code in question: ... if (srclen 2 !(data_in[1] PRESET_DICT) ((data_in[0] 0x0f) == Z_DEFLATED) !(((data_in[0]8) +

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Daniel Hazelton
On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: > On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: > > [1] For your reference, here is the user code in question: > > ... > > >if (srclen > 2 && !(data_in[1] & PRESET_DICT) && > > ((data_in[0] & 0x0f) == Z_DEFLATED) && > >

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Mark Adler
On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: [1] For your reference, here is the user code in question: ... if (srclen > 2 && !(data_in[1] & PRESET_DICT) && ((data_in[0] & 0x0f) == Z_DEFLATED) && !(((data_in[0]<<8) + data_in[1]) % 31)) { The funny thing

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Satyam Sharma wrote: Hi Artem, On 5/30/07, Artem Bityutskiy <[EMAIL PROTECTED]> wrote: Err, and important note is that it also wants this compressed data to be independently uncompressable. Hmm, okay. But what I meant was that if jffs2's needs are "standard" enough in the sense that they

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Satyam Sharma
Hi Artem, On 5/30/07, Artem Bityutskiy <[EMAIL PROTECTED]> wrote: Err, and important note is that it also wants this compressed data to be independently uncompressable. Hmm, okay. But what I meant was that if jffs2's needs are "standard" enough in the sense that they could conceivably be

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Artem Bityutskiy wrote: JFFS2 needs: it has _big_ input buffer, and _small_ output buffer, and it wants zlib to compress as much as possible from the input buffer, and make the output buffer full or nearly full of compressed data. Err, and important note is that it also wants this compressed

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Satyam Sharma wrote: Hmmm, either jffs2 thinks the zlib interfaces exposed through include/linux/zlib.h are insufficient, or it isn't using zlib properly (or at least the way it was supposed to be used :-) I do not remember many details, but yes, JFFS2 uses zlib trickily. Traditionally, zlib

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Satyam Sharma
Hi Mark, On 5/30/07, Mark Adler <[EMAIL PROTECTED]> wrote: On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: > skipping some checksum calculation if some > flag (PRESET_DICT) is absent from the input stream about to > be decompressed ... You don't need to dissect the header manually to look

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Daniel Hazelton
On Wednesday 30 May 2007 01:31:19 Mark Adler wrote: > On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: > > skipping some checksum calculation if some > > flag (PRESET_DICT) is absent from the input stream about to > > be decompressed ... > > You don't need to dissect the header manually to look

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Mark Adler
On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: [1] For your reference, here is the user code in question: ... if (srclen 2 !(data_in[1] PRESET_DICT) ((data_in[0] 0x0f) == Z_DEFLATED) !(((data_in[0]8) + data_in[1]) % 31)) { The funny thing here is that

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Daniel Hazelton
On Wednesday 30 May 2007 19:02:28 Mark Adler wrote: On May 30, 2007, at 6:30 AM, Satyam Sharma wrote: [1] For your reference, here is the user code in question: ... if (srclen 2 !(data_in[1] PRESET_DICT) ((data_in[0] 0x0f) == Z_DEFLATED) !(((data_in[0]8) +

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Daniel Hazelton
On Wednesday 30 May 2007 01:31:19 Mark Adler wrote: On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: skipping some checksum calculation if some flag (PRESET_DICT) is absent from the input stream about to be decompressed ... You don't need to dissect the header manually to look for that

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Satyam Sharma
Hi Mark, On 5/30/07, Mark Adler [EMAIL PROTECTED] wrote: On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: skipping some checksum calculation if some flag (PRESET_DICT) is absent from the input stream about to be decompressed ... You don't need to dissect the header manually to look for

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Satyam Sharma wrote: Hmmm, either jffs2 thinks the zlib interfaces exposed through include/linux/zlib.h are insufficient, or it isn't using zlib properly (or at least the way it was supposed to be used :-) I do not remember many details, but yes, JFFS2 uses zlib trickily. Traditionally, zlib

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Artem Bityutskiy wrote: JFFS2 needs: it has _big_ input buffer, and _small_ output buffer, and it wants zlib to compress as much as possible from the input buffer, and make the output buffer full or nearly full of compressed data. Err, and important note is that it also wants this compressed

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Satyam Sharma
Hi Artem, On 5/30/07, Artem Bityutskiy [EMAIL PROTECTED] wrote: Err, and important note is that it also wants this compressed data to be independently uncompressable. Hmm, okay. But what I meant was that if jffs2's needs are standard enough in the sense that they could conceivably be

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-30 Thread Artem Bityutskiy
Satyam Sharma wrote: Hi Artem, On 5/30/07, Artem Bityutskiy [EMAIL PROTECTED] wrote: Err, and important note is that it also wants this compressed data to be independently uncompressable. Hmm, okay. But what I meant was that if jffs2's needs are standard enough in the sense that they could

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Mark Adler
On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: skipping some checksum calculation if some flag (PRESET_DICT) is absent from the input stream about to be decompressed ... You don't need to dissect the header manually to look for that bit. If you feed inflate() at least the first two

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Daniel Hazelton
On Tuesday 29 May 2007 11:15:41 Satyam Sharma wrote: > [ Trimmed Cc list; added original zlib authors. ] > > > On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: > > > On 29 May 2007, at 12:27, Satyam Sharma wrote: > > > > Right, actually, zlib could be switched over to [using a common > >

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Satyam Sharma
[ Trimmed Cc list; added original zlib authors. ] On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: > On 29 May 2007, at 12:27, Satyam Sharma wrote: > > Right, actually, zlib could be switched over to [using a common > > directory]. > > Because zlib_deflate/ and zlib_inflate/ too share

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Daniel Hazelton
On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: > On 29 May 2007, at 12:27, Satyam Sharma wrote: > > Right, actually, zlib could be switched over to [using a common > > directory]. > > Because zlib_deflate/ and zlib_inflate/ too share a private header > > zutil.h which has unfortunately

JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Michael-Luke Jones
On 29 May 2007, at 12:27, Satyam Sharma wrote: Right, actually, zlib could be switched over to [using a common directory]. Because zlib_deflate/ and zlib_inflate/ too share a private header zutil.h which has unfortunately been stuck into include/linux/ with a big /* WARNING: this file

JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Michael-Luke Jones
On 29 May 2007, at 12:27, Satyam Sharma wrote: Right, actually, zlib could be switched over to [using a common directory]. Because zlib_deflate/ and zlib_inflate/ too share a private header zutil.h which has unfortunately been stuck into include/linux/ with a big /* WARNING: this file

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Daniel Hazelton
On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: On 29 May 2007, at 12:27, Satyam Sharma wrote: Right, actually, zlib could be switched over to [using a common directory]. Because zlib_deflate/ and zlib_inflate/ too share a private header zutil.h which has unfortunately been

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Satyam Sharma
[ Trimmed Cc list; added original zlib authors. ] On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: On 29 May 2007, at 12:27, Satyam Sharma wrote: Right, actually, zlib could be switched over to [using a common directory]. Because zlib_deflate/ and zlib_inflate/ too share a

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Daniel Hazelton
On Tuesday 29 May 2007 11:15:41 Satyam Sharma wrote: [ Trimmed Cc list; added original zlib authors. ] On Tuesday 29 May 2007 09:33:51 Michael-Luke Jones wrote: On 29 May 2007, at 12:27, Satyam Sharma wrote: Right, actually, zlib could be switched over to [using a common directory].

Re: JFFS2 using 'private' zlib header (was [RFC] LZO de/compression support - take 6)

2007-05-29 Thread Mark Adler
On May 29, 2007, at 8:15 AM, Satyam Sharma wrote: skipping some checksum calculation if some flag (PRESET_DICT) is absent from the input stream about to be decompressed ... You don't need to dissect the header manually to look for that bit. If you feed inflate() at least the first two