This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: jffs2 garbage collect


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).

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.


What is in your opinion the best approach?

Kind regards,

Jürgen Lambrecht
Development Engineer
Televic Transport Systems
http://www.televic.com
Televic NV / SA (main office)  	
Leo Bekaertlaan 1
B-8870 Izegem
Tel: +32 (0)51 303045
Fax: +32 (0)51 310670

Andrew Lunn wrote:
On Wed, Sep 20, 2006 at 04:16:43PM +0200, J?rgen Lambrecht wrote:

Hello,

this is the comment explaining jffs2 garbage collect:

# Enable background garbage collection thread, for making
# free space ahead of time. Leave this off till it's been
# implemented. And don't implement it till icache locking has
# been made thread-safe.

There is garbage collect code in ecos, so I suppost it is implemented.
And on my ARM7TDMI cpu, I don't have any cache, or is "icache" meaning something like "i-node cache" ?


icache is a jffs2 term, meaning i-node cache. There is a linked list
of inodes kept in memory. At the moment there is no mutex around
operations on this linked list. The eCos fileio code will serialise
access via the file system API so that only one thread will access
JFFS2 at once, but the gc thread does not use this API and so can use
the cache at the same time as normal file system operations.


Take a look at jffs2_i* functions in fs-ecos.c


So my question is, can I safely use the garbage collect thread?


No, i think not.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]