• Josef Bacik's avatar
    btrfs: pass root owner to read_tree_block · 1b7ec85e
    Josef Bacik authored
    In order to properly set the lockdep class of a newly allocated block we
    need to know the owner of the block.  For non-refcounted trees this is
    straightforward, we always know in advance what tree we're reading from.
    For refcounted trees we don't necessarily know, however all refcounted
    trees share the same lockdep class name, tree-<level>.
    
    Fix all the callers of read_tree_block() to pass in the root objectid
    we're using.  In places like relocation and backref we could probably
    unconditionally use 0, but just in case use the root when we have it,
    otherwise use 0 in the cases we don't have the root as it's going to be
    a refcounted tree anyway.
    
    This is a preparation patch for further changes.
    Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
    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>
    1b7ec85e
backref.c 82.6 KB