• Filipe Manana's avatar
    btrfs: pass an inode to btrfs_add_extent_mapping() · 0a308f80
    Filipe Manana authored
    Instead of passing fs_info and extent map tree arguments to
    btrfs_add_extent_mapping(), we can pass an inode instead, as extent maps
    are always inserted in the extent map tree of an inode, and the fs_info
    can be extracted from the inode (inode->root->fs_info). The only exception
    is in the self tests where we allocate an extent map tree and then use it
    to insert/update/remove extent maps. However the tests can be changed to
    use a test inode and then use the inode's extent map tree.
    
    So change btrfs_add_extent_mapping() to have an inode as an argument
    instead of a fs_info and an extent map tree. This reduces the number of
    parameters and will also be needed for an upcoming change.
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    0a308f80
extent_map.c 27 KB