• Josef Bacik's avatar
    btrfs: hold a ref on the root in build_backref_tree · 0b530bc5
    Josef Bacik authored
    This is trickier than the previous conversions.  We have backref_node's
    that need to hold onto their root for their lifetime.  Do the read of
    the root and grab the ref.  If at any point we don't use the root we
    discard it, however if we use it in our backref node we don't free it
    until we free the backref node.  Any time we switch the root's for the
    backref node we need to drop our ref on the old root and grab the ref on
    the new root, and if we dupe a node we need to get a ref on the root
    there as well.
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    0b530bc5
relocation.c 118 KB