• Q
    btrfs: remove btrfs_bio_alloc() helper · cd8e0cca
    Qu Wenruo 提交于
    The helper btrfs_bio_alloc() is almost the same as btrfs_io_bio_alloc(),
    except it's allocating using BIO_MAX_VECS as @nr_iovecs, and initializes
    bio->bi_iter.bi_sector.
    
    However the naming itself is not using "btrfs_io_bio" to indicate its
    parameter is "strcut btrfs_io_bio" and can be easily confused with
    "struct btrfs_bio".
    
    Considering assigned bio->bi_iter.bi_sector is such a simple work and
    there are already tons of call sites doing that manually, there is no
    need to do that in a helper.
    
    Remove btrfs_bio_alloc() helper, and enhance btrfs_io_bio_alloc()
    function to provide a fail-safe value for its @nr_iovecs.
    
    And then replace all btrfs_bio_alloc() callers with
    btrfs_io_bio_alloc().
    Signed-off-by: NQu Wenruo <wqu@suse.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    cd8e0cca
scrub.c 114.1 KB