hello,

thanks James and Charles for your answers, but I'm trying to do something different: I'm changing the checkpoint subsystem, but when a file is being deleted and a power loss happens, the old chunks that belong to the file that I was deleting remain on the disk. Let's consider the situation in which a checkpoint is committed ,and then a file deletion is started, and during the file deletion a power loss happens. When the system is rebooted, the checkpoint doesn't know anything about the deletion, and so some old chunks remain on the nand. If the gc hasn't time to recover them, the space used by such chunks grow ... for this reason, if many power loss happens during a file deletion I run out of the space. I know that the GC system can help me to clean the disk, but in case many power losses happens during a file deletion (this is a pretty rare case anyway), i'm in trouble, and I needed a way to scan  the live objects from ObjectBucket in order to map them to the chunks they are using and to eliminate the  others. I saw that SoftDeleteWorker() gives me the chunk groups: what is the difference between the chunk groups and the real chunks, and how can i map reap chunks starting from chunk groups? 

thanks for your help,
Marco

On Wed, Jul 28, 2010 at 3:58 PM, James Kehl <jamesk@edmi.com.au> wrote:

----- Original message -----
> Hello yaffers,
>
> a simple question: starting from the objects that I have on yaffs
> filesystem  (directories, files, symlinks, and so on) how can I identify
> all the chunks that are used by them?
>

Hi Marco,

Believe it or not, that's not a simple question - or at least it's not a simple question if you're actually wanting to use that data in something!

A simpler question (and I may be wrong, but I think it might be the question you really want answered) is "how do I get a list of all the pages in use by a particular file for my bootloader?"

Answer? You don't... Garbage collection and (maybe) wear levelling will move those pages around over time.

The canonical method for bootloaders to find the pages they need is for them to actually read the filesystem. (Also true for most filesystems these days. Even desktop Linux bootloaders do this now.)

If you're doing something more short-term with the chunk data - partition resizing? - I apologize for answering the wrong question :)

J