[PATCH]fs/jffs2/wbuf.c: add compatibility support for OOB data block

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Aug 16 05:47:46 EDT 2005

On Tue, 16 August 2005 11:25:40 +0400, Artem B. Bityuckiy wrote:
> Artem B. Bityuckiy wrote:
> >Wait, but how will you then find the needed struct jffs2_eraseblock
> >object by its physical offset on flash ? Use Hash / lists ? Bad idea
> >(slow). Use array of pointers to each object ? It will be rather large,
> >and I cannot take easy the fact that we will use distinct pointers for
> >objects which are mostly physically contiguous in RAM (they are laying
> >contiguously in slabs). This probably will neglect the pluses of
> >colouring, which, BTW, we may also organize using my way...
> >
> >Comments?
> This assumed to be a question for Joern, not to myself :-)

Yes, I'd go for a pointer array.  That would cost us one pointer
dereference per access.

Your approach, imo, is fundamentally borked because it requires
high-order allocations.  Your array of physical pages has to be a
contiguous virtual memory area, which won't always work.  And if you
want to maintain a list of pages instead, you end up with the same
design as with an array of slab objects, just one level higher and
with another indirection.  Whatever the performance is, the code will
be ugly.

You could - if you really want to play tricks - allocate objects that
contain 2, 4, 8, 16, etc. struct jffs2_eraseblocks instead of just
one.  But that wouldn't make the code any better, either.

Oh well.  If you volunteer to write the code and fix the bugs, you get
to decide.  I just have an opinion, nothing more.


"Security vulnerabilities are here to stay."
-- Scott Culp, Manager of the Microsoft Security Response Center, 2001

More information about the linux-mtd mailing list