On Sunday 06 February 2011 17:28:51 HuangAlex wrote:
> Hi,
>
> Is that mean each directory will take one chunk to store the object header
> and if there is some update for its children, yaffs will rewrite this
> object header on a new chunk? Thank you.
Yes
Each object (file, directory, hard link, softlink...) in the system has an
object header to hold its name and other details.
It is, however, better to think of this as part of the file than part of the
parent directory.
When an object's details are changed (time, name etc) then a new object header
is written for the object. The old object header is deleted and that space
can then be reclaimed by the garbage collector.
Each object has its own object Id. chunk Id 0 is always the object header.
Only data files have chunks with a chunk Id that is not zero.
-- Charles
>
> Alex
>
> > From: manningc2@actrix.gen.nz
> > To: yaffs@lists.aleph1.co.uk
> > Date: Fri, 4 Feb 2011 10:39:19 +1300
> > Subject: Re: [Yaffs] Question about Yaffs Directory
> >
> > On Friday 04 February 2011 08:49:31 HuangAlex wrote:
> > > Hi all,
> > >
> > > As mentioned in the note, yaffs treat everything as object. So i wonder
> > > how the directory structured in yaffs? Every directory have one chunk
> > > or many chunks? What is the chunkid and objectid for a directory?
> > >
> > > Thank you all.
> > >
> > > Alex
> >
> > Alex
> >
> > Please read http://www.yaffs.net/files/yaffs.net/HowYaffsWorks.pdf
> >
> > Directories are not stored in the flash. These are built up from the
> > object headers on the fly and formed into lists of objects in the same
> > directory.
> >
> > Each object knows which object is its parent. This is stored in the
> > object header
> >
> > For example consider:
> >
> > object id 500 file "a", parent is object id 503
> > object id 501 file "b", parent is object id 503
> > object id 502 directory "d", parent is 1 (1 is the root)
> > object id 503 directory "dir" parent is 502
> >
> > that gives us the following paths
> > object id 1"/"
> > object id 500 "/d/dir/a"
> > object id 501 "/d/dir/b"
> > object id 502 "/d"
> > object id 503 "/d/dir"
> >
> >
> >
> >
> > _______________________________________________
> > yaffs mailing list
> > yaffs@lists.aleph1.co.uk
> > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs