Thanks for reply. your explanation was very useful.  I looked at yaffs_guts.c file. It has different parts and I did not find the log structure. What is the name of that? In which part is the code locate exactly?(In Data file manipulation, or file read/write ,...)  Could you address it Please? ________________________________ From: Charles Manning To: yaffs@lists.aleph1.co.uk; S. K. Sent: Wednesday, July 11, 2012 2:57 AM Subject: Re: [Yaffs] yaffs journaling On Wednesday 11 July 2012 04:06:10 S. K. wrote: > Thanks Chareles for reply. > > > As I understood, The main aim of Journaling is using some mechanism in > order to recover from fail states of system.(Is it right?) one of its > alternative is log-structure that has been implemented in the YAFFS. I read > the document but I could not understand the recovery details. Can everyone > help me more about that? Try reading the Wikipedia article. Corruptions in regular file systems happen because there are typically many things that need to be changed to implement a change. For example, you need to allocate space, then write file data, then fix up file linked lists, If power is lost part way through this then the file system is in a bad state. The basic idea behind journalling is that you make a note of the changes that you are going to make, then make the changes, then make a note that you have made those changes. If power is lost part way through then you can figure out what was happening at the time and either roll the changes forwards (ie. re-do them) or roll back (ie. reverse them out). A log structure just write changes to the end of the log. > > Where the log-structure mechanism has implemented in the YAFFS source > code?(Which C file or files contains that?) yaffs_guts.c -- Charles > > > > > > ________________________________ >  From: Charles Manning > To: S. K. > Sent: Sunday, July 8, 2012 2:42 PM > Subject: Re: [Yaffs] yaffs journaling > > On Sunday 08 July 2012 17:06:58 S. K. wrote: > > Good day everybody! > > > > > > I am looking for a document that describes in ditail: how YAFFS do > > journaling? > > > > What is the mechanism of journaling in yaffs?  Could you help me please? > > Hello SK > > Yaffs is really a log-structured file system and not a journalled file > system. I know I have used the term "journal" in the past but that was > applied loosely and is wrong. > > The difference is that a journalling file system has a regular file system > formal and writes a journal of its activities allowing state to be fixed if > an error a occurs. An example is the Linux ext3/ext4 file system. This used > the Linux ext2 formal as regular storage but has a journal to help correct > issues if power is lost. > > A log structured file system is different in that there is no regular file > system component. In a log structured file system, >  the journal is the file > system. > > Thus, for the purposes of what you are trying to understand, you may treat > the terms journal and log the same. > > The HowYaffsWorks document has an explanation for how data is written into > the flash and how the recovery works. > > Regards > > Charles