Modify a non empty file

echo 123123 > foo.txt
We would like to update a file and add new data to the end of the file. JFFS2 tries to open a file by filename. jffs2_lookup() is called to determine the inode number of the file. jffs2_lookup() goes through the entries of the directory to find the entry that has the same nhash, name length, etc. If it finds it then calls the iget() function to read the inode into memory, builds up the full inode structure. Then jffs2_prepaire_write() is called and if the offset of the new page is bigger than the current EOF then it builds a new hole fragment from the current EOF's offset to the new page. If it returns then generic_file_buffered_write() (VFS) copies the data into pages, and per page basis jffs2_commit_write() is called to write the page out to the flash.



Havasi Ferenc 2005-12-22