• Qu Wenruo's avatar
    btrfs: allow btrfs_bio_fits_in_stripe() to accept bio without any page · 1a0b5c4d
    Qu Wenruo authored
    Function btrfs_bio_fits_in_stripe() now requires a bio with at least one
    page added.  Or btrfs_get_chunk_map() will fail with -ENOENT.
    
    But in fact this requirement is not needed at all, as we can just pass
    sectorsize for btrfs_get_chunk_map().
    
    This tiny behavior change is important for later subpage refactoring on
    submit_extent_page().
    
    As for 64K page size, we can have a page range with pgoff=0 and size=64K.
    If the logical bytenr is just 16K before the stripe boundary, we have to
    split the page range into two bios.
    
    This means, we must check page range against stripe boundary, even adding
    the range to an empty bio.
    
    This tiny refactoring is for the incoming changes, but on its own,
    regular sectorsize == PAGE_SIZE is not affected anyway.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.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>
    1a0b5c4d
inode.c 299 KB