• Josef Bacik's avatar
    btrfs: do not use a function to initialize btrfs_ref · 4d09b4e9
    Josef Bacik authored
    btrfs_ref currently has ->owning_root, and ->ref_root is shared between
    the tree ref and data ref, so in order to move that into btrfs_ref
    proper I would need to add another root parameter to the initialization
    function.  This function has too many arguments, and adding another root
    will make it easy to make mistakes about which root goes where.
    
    Drop the generic ref init function and statically initialize the
    btrfs_ref in every usage.  This makes the code easier to read because we
    can see what elements we're assigning, and will make the upcoming change
    moving the ref_root into the btrfs_ref more clear and less error prone
    than adding a new element to the initialization function.
    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>
    4d09b4e9
relocation.c 117 KB