Unionfs ODF2: Documenting the export operations for Unionfs
authorRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Sun, 16 Dec 2007 18:13:21 +0000 (13:13 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:27 +0000 (19:03 -0400)
Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
Documentation/filesystems/unionfs/odf.txt

index 198815edde75e167fdbdabd9aba3541d390258e8..03ee6793141e7c5c6f928e86f66d65f99a2463d6 100644 (file)
@@ -539,6 +539,42 @@ plus update /odf/ns as described, then link the dst to the src.  If someone
 creates a new hardlink to an already copied up file, then we will see that
 as existing info in /odf/ns.
 
+** Export Operations
+
+Unionfs mounted files can be exported over NFS.  Following is a short
+description of how the export operations are implemented.
+
+* Filehandle Format:
+In addition to the inode number and generation, we also store the i_mode
+of the inode in the filehandle.  This is needed when we do not find the
+unionfs inode in the inode cache and have to reconstruct it from scratch.
+This can also be derived from the corresponding lower level inodes, but
+if this object is disconnected, we will need to first reconnect all its
+ancestors.  Instead, saving the i_mode in the filehandle is a much more
+convenient solution.
+
+* unionfs_encode_fh: Construct a filehandle corresponding to a dentry.
+- If dentry is a directory, fill in the dentry's inode number, generation
+  number and the inode's i_mode.
+- Else, fill in the inode number, generation and i_mode of the dentry and
+  its parent.
+
+* unionfs_fh_to_dentry: Reconstruct a dentry from the filehandle
+- Get a unionfs inode for the inode number and create a dentry.
+- Fill in the mode for the inode from the i_mode encoded in the filehandle.
+
+* unionfs_fh_to_parent: Reconstruct a dentry's parent from the filehandle
+- Similar to unionfs_fh_to_dentry
+
+* unionfs_get_name: Get the name for a unionfs dentry
+- Look for the dentry in its parents directory in odf, and hence obtain its
+  name.
+
+* unionfs_get_parent: Get the parent for a unionfs dentry
+- Obtain the parent from odf.
+- Also, find all the disconnected ancestors of the dentry, and connect them
+  all.
+
 
 * CREDITS