• Qu Wenruo's avatar
    btrfs: move end_io_func argument to btrfs_bio_ctrl structure · 5467abba
    Qu Wenruo authored
    For function submit_extent_page() and alloc_new_bio(), we have an
    argument @end_io_func to indicate the end io function.
    
    But that function never change inside any call site of them, thus no
    need to pass the pointer around everywhere.
    
    There is a better match for the lifespan of all the call sites, as we
    have btrfs_bio_ctrl structure, thus we can put the endio function
    pointer there, and grab the pointer every time we allocate a new bio.
    
    Also add extra ASSERT()s to make sure every call site of
    submit_extent_page() and alloc_new_bio() has properly set the pointer
    inside btrfs_bio_ctrl.
    
    This removes one argument from the already long argument list of
    submit_extent_page().
    Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    5467abba
extent_io.c 160 KB