lkml.org 
[lkml]   [1999]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: fsync on large files
    Hi,

    Linus Torvalds wrote:
    > Imagine, for example, a directory tree with a shared component. Wouldn't
    > it be nice to just link it into the tree at multiple points? Imagine a
    > chroot() environment, for a moment - symlinks don't work to the outside,
    > but hardlinking does.

    Sure, it would be nice. But it's really hard and not easy to implement.

    The traditional unix filesystem forms a nice n-ary tree. Symbolic links
    turn your tree into a graph. But, it is required, that the tree be
    preserved by the hard links. The soft links are just there to go
    somewhere in different ways. They do not _build_ the tree.

    mkdir creates a new leaf node, unlink removes one, and rename moves a
    subtree to a different location. Checks like: you mustn't move a dir
    to one if its descendants (meaning, you mustn't disconnect a subtree
    from the main tree), are easy because there's only _one_ point where
    this node is connected to the tree.

    If you allow directory hardlinks (or loopback mounts) you get a completely
    different structure: a directed graph with all it's problems (like rings).
    Reconfiguring a graph with some constraints like: you mustn't isolate a
    subgraph from the one containing the root node, is pretty hard. You
    have to scan the _whole_ graph to check this. And, try to remove a
    part of the graph. There may be _no_ leaf nodes, only rings. This means,
    you have to allow to unlink non-empty dirs. And this results in a garbage
    collector...

    Yeah, would be nice, but hard *g*

    Ciao, ET.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:50    [W:3.166 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site