[ECOS] jffs2 garbage collect

Andrew Lunn andrew@lunn.ch
Wed Sep 20 15:25:00 GMT 2006


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? 

     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