public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Stanislav Meduna <stano@meduna.org>
To: ecos-devel@ecos.sourceware.org
Subject: jffs2 garbage collect thread
Date: Mon, 20 Feb 2012 11:42:00 -0000	[thread overview]
Message-ID: <4F423195.8070102@meduna.org> (raw)

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

                 reply	other threads:[~2012-02-20 11:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F423195.8070102@meduna.org \
    --to=stano@meduna.org \
    --cc=ecos-devel@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).