|
In libfstree, add a function to add a hard link to the fstree. The
hard links stores the target in the data.target field, canonicalizes
the target and sets a sentinel mode. A second function is used to
resolve link, i.e. replacing it with a direct pointer, setting another
sentinel mode and increasing the targets link count.
The post process function tries to resolve unresolved hard links and
only allocates inode numbers for nodes that aren't hard links. If the
target node of a hard link does not have an inode number yet, the two
need to be swapped, since this is also the order in which they are
serialized.
The serialization function in libcommon simply has to skip hard link
nodes and when writing directory entries, use the inode num/ref of
the target node.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|