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

Artem B. Bityuckiy dedekind at yandex.ru
Tue Aug 16 05:56:47 EDT 2005


Jörn Engel wrote:
> 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.

I meant something like:

objs_per_page = PAGE_SIZE / sizeof(struct jffs2_eraseblock);
pages_num = c->blocks_nr / objs_per_page;

for (i = 0; i < pages_num; i++) {
     page = alloc_pages(flags, 0);
     c->blocks[i] = page_address(page);
}

So c->blocks[] is an array of pages. Nonetheless, I have never done 
things like this before, may be there is some cleverer method exists...

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.





More information about the linux-mtd mailing list