Re: [Yaffs] Question about metadata

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Eugene Soh
Date:  
To: yaffs
Subject: Re: [Yaffs] Question about metadata

Hi Alex,

I believe you are a little confused. The way I generally understand YAFFS is:

The chunkId (stored on spare area) is used to define the order of the chunk within the object.
chunkIds are reset to 0 for every new object.
A chunkID of 0 is used to denote the header of an object (file, directory, etc.)
chunkIDs for files are incremented depending on the size of the file. (usually size in bytes / size of data area)

The byteCount (also stored on spare area) is used to store the number of bytes stored in the chunk which is related to the file.
byteCount is usually the size of the data area except for the last chunk which is ( size of file % size of data area)
byteCount of 65535 (0xFF 0xFF) is used to denote an object header.

The yaffs object header (stored on data area) has chunkId 0 for all objects.
The yaffs object header stores the, object type (directory, file, link, etc.), name (filename, folder name), object size in bytes (for files) and other file metadata (permissions, file timestamps, etc.)

Hope this explanation helps you to understand YAFFS better.

Regards,
Eugene

> From:
> Subject: yaffs Digest, Vol 68, Issue 11
> To:
> Date: Wed, 26 Jan 2011 12:00:03 +0000
>
> Send yaffs mailing list submissions to
>     

>
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
> or, via email, send a message with subject or body 'help' to
>     

>
> You can reach the person managing the list at
>     

>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of yaffs digest..."
>
>
> Today's Topics:
>
>    1. Re: Question about metadata (???)
>    2. Re: Question about metadata (Charles Manning)

>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 25 Jan 2011 22:03:53 +0800
> From: ??? <>
> Subject: Re: [Yaffs] Question about metadata
> To: <>
> Message-ID: <>
> Content-Type: text/plain; charset="gb2312"
>
>
> But how about the change of chunkid? Chunk id along whith byte count give the location of the chunk inside the object. Does chunkid return to 0 when it reach the max number in a block? I saw in the yaffs header it have 32bits so how it changes in block? Thank you.
>
> Regards
>
> Alex
>
> > Subject: Re: [Yaffs] Question about metadata
> > From:
> > To:
> > Date: Tue, 25 Jan 2011 08:50:07 +0000
> >
> > Hi Alex,
> >
> > >From the document HowYaffsWorks:
> >
> > ? Sequence Number: As each block is allocated, the file system's
> > sequence number is incremented and each chunk
> > in the block is marked with that sequence number. The sequence number
> > thus provides a way of organising the log
> > in chronological order.
> >
> > So it looks like the SequenceNumber may help with what you want to do.
> >
> > Regards
> >
> > Brian.
> >
> >
> > On Tue, 2011-01-25 at 11:23 +0800, ??? wrote:
> > > Hi all,
> > >
> > > I have a basic question. As we know the Chunkid will start from 0 to
> > > the max number of chunks in one block. And it will contiune from 0 to
> > > the next block. So how we can distinguish these different chunks in
> > > different block? Do we have a kind of "blockid" in yaffs? I did not
> > > see that in yaffs header. What kind of method can help doing the
> > > allocation ? Another question, i still do not know the function of
> > > sequence number. Thank you guys.
> > >
> > > Alex
> > > _______________________________________________
> > > yaffs mailing list
> > >
> > > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
> >
>                       
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.aleph1.co.uk/lurker/list/yaffs.html/attachments/20110125/b8d2325b/attachment.htm>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 26 Jan 2011 12:14:15 +1300
> From: Charles Manning <>
> Subject: Re: [Yaffs] Question about metadata
> To:
> Message-ID: <>
> Content-Type: text/plain; charset="utf-8"
>
> Hello
>
> On Wednesday 26 January 2011 03:03:53 ??? wrote:
> > But how about the change of chunkid? Chunk id along whith byte count give
> > the location of the chunk inside the object.
>
> The chunk Id in the tags (metadata) says where the chunk is in the file. The
> object Id says which file it is in.
>
> Thus consider a 5kbyte file (2k bytes per chunk) with object Id 500. It will
> have:
>
> objId 500, chunkId 0: This is the object header that holds the file name,
> permissions etc.
> objId 500, chunkId 1, nbytes 2k: This holds the first 2k of the file
> objId 500, chunkId 1, nbytes 2k: This holds the next 2k of the file
> objId 500, chunkId 1, nbytes 1k: This holds the last 1k of the file.
>
>
> > Does chunkid return to 0 when
> > it reach the max number in a block?
>
> No. The chunkId in the tags has nothing to do with the block it is in. It is
> only tied to the position in the file.
>
> Thus there is no dependency on thee physical location of the chunks in a file
> to where they are in the flash.
>
> There is no need for a block Id.
>
> > I saw in the yaffs header it have
> > 32bits so how it changes in block? Thank you.
>
> Why do you want to change the block?
>
>
>
> > >
> > > >From the document HowYaffsWorks:
> > >
> > > ? Sequence Number: As each block is allocated, the file system's
> > > sequence number is incremented and each chunk
> > > in the block is marked with that sequence number. The sequence number
> > > thus provides a way of organising the log
> > > in chronological order.
> > >
> > > So it looks like the SequenceNumber may help with what you want to do.
>
>
>
> ------------------------------
>
> _______________________________________________
> yaffs mailing list
>
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>
> End of yaffs Digest, Vol 68, Issue 11
> *************************************