* jffs2 garbage collect thread
@ 2012-02-20 11:42 Stanislav Meduna
0 siblings, 0 replies; only message in thread
From: Stanislav Meduna @ 2012-02-20 11:42 UTC (permalink / raw)
To: ecos-devel
Hi,
anyone knows whether it is now safe to enable the JFFS2 garbage
collect thread?
The CDL comment says:
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.
The icache locking probably is not thread-safe per-se, but
the fs-ecos.c says
FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
and the thread itself does cyg_fs_lock around the garbage
collect pass
cyg_fs_lock(mte, mte->fs->syncmode);
if (jffs2_garbage_collect_pass(c) == -ENOSPC) {
printf("No space for garbage collection. "
"Aborting JFFS2 GC thread\n");
break;
}
cyg_fs_unlock(mte, mte->fs->syncmode);
To me it looks safe - am I overlooking something?
The reason I need to control garbage collect explicitely is that
I need to make sure a filesystem has some amount of free space
before starting an operation. So I want to trigger a garbage collect
explicitely and then decide according to the superblock information.
Can I use this model or are there any hidden dangers?
Thanks
--
Stano
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-20 11:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-20 11:42 jffs2 garbage collect thread Stanislav Meduna
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).