Re: [Yaffs] Question about metadata

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Question about metadata
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.