• Eric Sandeen's avatar
    libext2fs: Teach extent.c how to split nodes · 9fd6a96d
    Eric Sandeen authored
    
    
    When called for a given handle, the new function extent_node_split()
    will split the current node such that half of the node's entries will
    be moved to a new tree block.  The parent will then be updated to
    point to the (now smaller) original node as well as the new node.
    
    If the root node is requested to be split, it will move all
    entries out to a new node, and leave a single entry in the
    root pointing to that new node.
    
    If the reqested split node's parent is full it will recursively
    split up to the root to make room for the new node's insertion.
    
    If you ask to split a non-root node with only one entry,
    it will refuse (we'd have an empty node otherwise).
    
    It also updates the i_blocks count when a new block has
    successfully been connected to the tree.
    Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    9fd6a96d
ext2_err.et.in 9.25 KB