[ECOS] jffs2 garbage collect

Jürgen Lambrecht Jurgen.Lambrecht@tiscali.be
Thu Sep 21 07:22:00 GMT 2006

Andrew Lunn wrote:
> On Wed, Sep 20, 2006 at 05:07:58PM +0200, J?rgen Lambrecht wrote:
>>Thanks for your fast reply Andrew.
>>The problem I have is that the user will first delete files from flash to 
>>make place, and then tftp files to flash. But the place only really 
>>becomes available after a garbage collect (or after reboot).
> The garbage collection code is also run when the filesystem is 'full',
> ie it cannot allocate space for new data. I will run the garbage
> collection code and then try the allocation again. This is why all the
> comments say that the garbage collection they is only nice to have,
> not required.
>>To delete files, we use a "magic" deletion file. At the end of processing 
>>that file, I want to add garbage collection.
>>- I could do this by starting the GC thread, and then stopping it again.
>>- Or maybe better, by calling myself jffs2_garbage_collect_pass(c).
>>- Or I guess I could also unmount jffs2 and mount it again.
> Only the last option is safe. The others potentially could cause
> filesystem corruption.
> What is wrong with having garbage in your filesystem anyway? 
Because the garbage represents free space that is not available. Our 
customer wants to update the files in flash twice a year. This is 
potentialy all files. In worst case, all data must first be deleted and 
then new data uploaded.

Thanks for your replies,
>      Andrew

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list