Create a non empty file

echo data >foo.txt
First the fs tries to open the file that doesn't exists, then it creates one with jffs2_create(). Kernel writes the data into the page_cache and writes out the cache per page basis. VFS calls jffs2_commit_write to write out the page. It allocates a raw_inode and sets the fields that the generic jffs2_write_inode_range() function can't find. jffs2_write_inode_range() is called and it writes out the page in small parts depending on the size of the data, compressor, available space on flash in the current jeb. It adds the written dnode to the inode cache and inode info after each write operation and adds the new fragment to the fragtree. If all data is written out or an error occurred jffs2_write_inode_range() returns. jffs2_commit_write frees the jffs2_raw_inode and returns.



Havasi Ferenc 2005-12-22