[JFFS2] GC patch for eCos port

Per Hedblom per.hedblom at abem.se
Thu Nov 11 08:19:29 EST 2004


On Thursday 11 November 2004 12:28 David Woodhouse Wrote
>Yes, that is the expected behaviour and looks like the correct fix. I've
>just committed the corresponding change to the eCos version of
>jffs2_gc_fetch_page().

Will this code handle files larger than PAGE_SIZE?
I believe the patch for ecos should look like:
{
        /* FIXME: This works only with one file system mounted at a time */
        int ret;

        ret = jffs2_read_inode_range(c, f, gc_buffer, offset,
PAGE_CACHE_SIZE);
        if (ret)
                return ERR_PTR(ret);

        return gc_buffer - ( offset & ( PAGE_CACHE_SIZE - 1 ) );
}

if you want to do it in fs-ecos.c. (This works in our test case but I think
I prefer the original patch suggested by Mark for readbility.)



>The eCos port could definitely do with some love 

I agree, it is hard to believe that anyone can successfully use the jffs2
file system as a general file system in eCos.

Some experience with jffs2 for eCos so far: 
* it requires a lot of software maintenance to keep it updated and tested
for the a specific usage in eCos.
 
* it uses a lot of memory and memory management - a eCos system without
memory management needs fixed memory pools to run stable for a long time. 
We use a lot of small files and if someone is considering jffs2 for a new
design I would recommend reserving a ram space for jffs2 that is in the
range of the flash area in use.

* it doesn't do gc as a thread in eCos. This means that it almost always
want to do gc at the time when you need to write data.


Tanks,
Per Hedblom








More information about the linux-mtd mailing list