[PATCH] remove support for virtual blocks

Jörn Engel joern at wohnheim.fh-wedel.de
Thu Sep 8 13:55:28 EDT 2005


On Wed, 7 September 2005 14:52:45 +0800, zhao forrest wrote:
> 
> I agree with you that "slab cache" is a good idea. But "struct 
> jffs2_eraseblock are put into a linked list or similar structure" is
> not a perfect solution IMO. In JFFS2 code, there're several places
> where the jeb is got by block_nr. So if struct jffs2_eraseblock are
> put into linked list, the time of searching a jeb by block_nr will
> not be O(1).
> 
> The data structure in my mind is "pointer array + slab cache".
> So jeb is got by jeb = blocks[block_nr].element;, element is a 
> pointer to struct jffs2_eraseblock.
> 
> Does it make sense?

Mostly.  Why do you want the element part?

struct jffs2_eraseblock *blocks;
...
blocks = kmalloc(...);
...
jeb = blocks[block_nr];

Jörn

-- 
Don't worry about people stealing your ideas. If your ideas are any good,
you'll have to ram them down people's throats.
-- Howard Aiken quoted by Ken Iverson quoted by Jim Horning quoted by
   Raph Levien, 1979




More information about the linux-mtd mailing list