Ok, the missing gaps in my knowledge of JFFS2 are filling as I get
deeper into the code. There's not much code to it really, but the BBC
framework is kinda messy.

What I meant by the BBC framework getting me off-track (and
deprecating the old code, even though the old code is still used..
therefore not really depecating) was....

JFFS2-BBC is actually integrated into JFFS2 by replacing the ZLIB
encoder interface. So, everytime JFFS2 invokes the ZLIB de/encoder,
the BBC framework interates through its available compressors and
chooses the appropriate one for the block (the original ZLIB is one of
these options).

When I wrote the last email I had decided to integrate LZMA into the
BBC framework extensions, but I've now changed my mind, so am back to
the original idea ;p. I'll add LZMA to the original JFFS2 code, as it
is most appropriate to put there, and this has the option of allowing
you to omit the BBC framework if one desires.

I need to do some testing to see how much the BBC framework actually
helps anyway. It sure does slow down compression time when it's in
SIZE mode since it iterates through no less than 5 compressors!

So, here's a map of the JFF2 encoders (not sorted by default priorities):

JFFS2
   RUBINMIPS (deprecated)
   DYNRUBIN (partially deprecated, see below)
   RTIME
   ZLIB -> BBC ->
                          LZARI
                          LZO
                          LZSS
                          LZHD
                          ZLIB



Adding LZMA to the list obviously makes it:

JFFS2
   LZMA (new, whohoo)
   RUBINMIPS (deprecated)
   DYNRUBIN (partially deprecated, see below)
   RTIME
   ZLIB -> BBC ->
                          LZARI
                          LZO
                          LZSS
                          LZHD
                          ZLIB


Why am I writing all this up? I like to see myself write. And besides
that, maybe someone will care, as I've found most of linux poorly
documented. Sure, you can go through the code, and some of it is
self-documenting, but other parts (like BBC) are kinda messy IMHO.

.......................

So where am I at now? Well, I'm neglecting my proper work, which means
I'll soon be homeless. Oh, with LZMA, yea... Well, the code, like I've
said, is there, but there's a couple bugs I want to address and
improvements to the LZMA encoding.

........................

Some misc. notes on JFFS2 that are unrelated to this project:

1.) The DYNRUBIN decompressor is included for backwards compatibility,
but the DYNRUBIN encoder was long ago removed, on 9/23/01. This means
as long as your filesystem was built with a copy 9/23/01, there's no
way DYNRUBIN is used, and even if it was built before that, it's
probably not used is practice:

See line 138 of fs/jffs2/compr.c:
--------------------------------------------------------------------------------------
        case JFFS2_COMPR_DYNRUBIN:
#if 1 /* Phase this one out */
                dynrubin_decompress(cdata_in, data_out, cdatalen, datalen);
#else
                printk(KERN_WARNING "JFFS2: Dynrubin compression encountered but
support not compiled in!\n");
#endif
                break;
--------------------------------------------------------------------------------------

RECOMMENDATION: Go ahead and phase out DYNRUBIN decoder and save a few
bytes. The decoder is small, but every bit helps. I'll send a seperate
patch for this.

2.) Once I do some real-time testing I can evaluate which encoders are
used and probably trim down BBC considerably so that it's much faster.
It might even be ok to remove it all-together.

--
Jeremy Collake
Bitsum Technologies
www.bitsum.com
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to