156b36b libgfs2: Use the correct parent for rgrp tree insertion

Authored and Committed by andyp 9 years ago
    libgfs2: Use the correct parent for rgrp tree insertion
    
    lgfs2_rgrps_append() was using the parent of the last rgrp instead of
    the last rgrp itself as the intended parent when inserting new rgrps
    into the tree. This left the tree unbalanced in such a way as to make
    lookups of the last node in the tree effectively a linear list search.
    This was done for each rgrp insertion so, although it didn't cause a
    noticeable slow-down for smaller file sytems, tests on 250TB volumes
    requiring over a million resource groups would become CPU bound and
    could take hours to complete.
    
    This patch fixes lgfs2_rgrps_append() to use the correct parent node for
    rgrp tree insertions, giving a significant performance improvement when
    creating file systems on large volumes.
    
    Resolves: rhbz#1194446
    
    Signed-off-by: Andrew Price <anprice@redhat.com>
    
        
file modified
+2 -3