Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
page that was written

fill_shadow_tree - Propagate shadow tree changes due to a write : Inode owning the page

: Shadow for the current write

Writes in logfs can result in two semi-valid objects. The old object is still valid as long as it can be reached by following pointers on the medium. Only when writes propagate all the way up to the journal has the new object safely replaced the old one.

To handle this problem, a struct logfs_shadow is used to represent every single write. It is attached to the indirect block, which is marked dirty. When the indirect block is written, its shadows are handed up to the next indirect block (or inode). Untimately they will reach the master inode and be freed upon journal commit.

This function handles a single step in the propagation. It adds the shadow for the current write to the tree, along with any shadows in the page's tree, in case it was an indirect block. If a page is written, the inode parameter is left NULL, if an inode is written, the page parameter is left NULL.