Skip to content
Snippets Groups Projects
  • Yorhel's avatar
    6de0a8ec
    Use correct hard link information after partial recalculation or deletion · 6de0a8ec
    Yorhel authored
    Hard link detection is now done in a separate pass on the in-memory tree,
    and duplicates can be 'removed' and 're-added' on the fly. When making any
    changes in the tree, all hard links are re-added before the operation and
    removed again afterwards.
    
    While this guarantees that all hard link information is correct, it does
    have a few drawbacks. I can currently think of two:
    
     1. It's not the most efficient way to do it, and may be quite slow on
        large trees. Will have to do some benchmarks later to see whether
        it is anything to be concerned about.
    
     2. The first encountered item is considered as 'counted' and all items
        encountered after that are considered as 'duplicate'. Because the
        order in which we traverse the tree doesn't always have to be the
        same, the items that will be considered as 'duplicate' can vary with
        each deletion or re-calculation. This might cause confusion for
        people who aren't aware of how hard links work.
    6de0a8ec
    History
    Use correct hard link information after partial recalculation or deletion
    Yorhel authored
    Hard link detection is now done in a separate pass on the in-memory tree,
    and duplicates can be 'removed' and 're-added' on the fly. When making any
    changes in the tree, all hard links are re-added before the operation and
    removed again afterwards.
    
    While this guarantees that all hard link information is correct, it does
    have a few drawbacks. I can currently think of two:
    
     1. It's not the most efficient way to do it, and may be quite slow on
        large trees. Will have to do some benchmarks later to see whether
        it is anything to be concerned about.
    
     2. The first encountered item is considered as 'counted' and all items
        encountered after that are considered as 'duplicate'. Because the
        order in which we traverse the tree doesn't always have to be the
        same, the items that will be considered as 'duplicate' can vary with
        each deletion or re-calculation. This might cause confusion for
        people who aren't aware of how hard links work.