[PATCH] remove support for virtual blocks

zhao forrest zhao_fusheng at hotmail.com
Wed Sep 7 02:52:45 EDT 2005


>
>Take 3: slab cache
>
>This would be my preferred solution, although it also has drawbacks
>and is a lot of work.  Instead of organizing the struct
>jffs2_eraseblock in an array, they are put into a linked list or
>similar structure.  Now it is possible to allocate the structures one
>at a time, using a dedicated slab cache.  Drawback is a different
>handling of blocks and increasing the struct jffs2_eraseblock by one
>struct list_head - 8 or 16 bytes depending on your architecture.
>
Hi, Joern

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?

Thanks,
Forrest






More information about the linux-mtd mailing list