The useHeaderFileSize flag controls how the file size is calculated during scanning etc. For YAFFS1 you have the option of using the header file size (ie those recorded in the objectheaders) or the size calculated by scanning. Because YAFFS1 marks discarded chunks it is possible to fully recreate file sizes without looking at the file header information. YAFFS2 does not discard data (mark it deleted), so when YAFFS2 scans it must look at file headers to track file size changes. That is why the useHeaderFileSize is forced on in the GutsInitialise. If you defeat this then YAFFS2 file sizes will be wrong. What I meant when I said that this option was not useful in YAFFS2 was that you should not adjust it for YAFFS2. ie. For YAFFS2 it is not something that is an option you can play with. It is only something you can play with for YAFFS1. -- CHarles On Friday 04 February 2005 17:46, Abhishek Bhattacharya wrote: > Hi > > If > if(dev->isYaffs2) > { > dev->useHeaderFileSize = 1; > } > is true, in that case, oh->fileSize doesnot get the actual file size. > Thus object's file size remains as 0. While scanning , yaffs2 assigns > the > Size of the file to scannedFileSize. And then the next condition is > > else if(tags.chunkId > 0) > { > ///code > if(!dev->useHeaderFileSize) > { > in->variant.fileVariant.fileSize = > > in->variant.fileVariant.scannedFileSize; > } > ///code > } > > And last but not the least > "The useHeaderFileSize option is only useful for YAFFS1" > "Defeat this and YAFFS2 will break" ... Could you kindly throw some more > Light on that please? I feel these two statements slightly contradict. > > Regards > Abhishek > > > -----Original Message----- > From: Charles Manning [mailto:manningc2@actrix.gen.nz] > Sent: Friday, February 04, 2005 6:02 AM > To: Abhishek Bhattacharya; yaffs@stoneboat.aleph1.co.uk > Subject: Re: [Yaffs] An observation about "useHeaderFileSize" ! > > >The useHeaderFileSize option is only useful for YAFFS1. > > > >YAFFS2 needs to use this otherwise various things break. > >For this reason, yaffs_GutsInitialise forces this on for YAFFS2 in the > > the following lines: > >if(dev->isYaffs2) > >{ > >dev->useHeaderFileSize = 1; > >} > > > >Defeat this and YAFFS2 will break. > > On Friday 04 February 2005 01:08, Abhishek Bhattacharya wrote: > >> Hello Yaffs ers and Charles > >> > >> I want to report an observation I had when testing Yaffs2 direct > >> interface. In yaffs2 we have the option of "useHeaderFileSize". > >> Now in yaffs_Scan() , after we scan all blocks, we check if "yaffs2" > >> option is enabled or not. > >> > >> If yaffs2 is enabled we make dev->useHeaderFileSize = 1. Upon > > enabling > > >> this, the expected result would be , that object would get the file > >> size from object header, and not from scanned file size. > >> > >> Now when we do dumpDir(const char* path), my observation was that , > > it > > shows all the files , but sizes are shown as 0. > > >> > >> At this point , I tried to make dev->useHeaderFileSize = 0. So now , > >> we directly assign the object's scanned file size to object's file > >> size and VOILA!!! Everything seems to work fine. This time > >> dumpDir(const char* path) returns all the files with there respective > >> > >> sizes!!! > >> > >> Please let me know if you have encountered any such issues! > >> > >> Thanks > >> > >> Abhishek > >> > > *************************************************************************** >**************************************************************************** >*** > > This email message is for the sole use of the intended recipient(s)and may > contain CONFIDENTIAL and PRIVILEGED information. LG Soft India will not be > responsible for any viruses or defects or any forwarded attachments > emanating either from within LG Soft India or outside. Any unauthorized > review, use, disclosure or distribution is prohibited. If you are not the > intended recipient, please contact the sender By reply email and destroy > all copies of the original message. > > *************************************************************************** >**************************************************************************** >*** > > _______________________________________________ > yaffs mailing list > yaffs@stoneboat.aleph1.co.uk > http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs