• Qu Wenruo's avatar
    btrfs: support page uptodate assertions in subpage mode · b8f95771
    Qu Wenruo authored
    There are quite some assert checks on page uptodate in extent buffer
    write accessors.  They ensure the destination page is already uptodate.
    
    This is fine for regular sector size case, but not for subpage case, as
    for subpage we only mark the page uptodate if the page contains no hole
    and all its extent buffers are uptodate.
    
    So instead of checking PageUptodate(), for subpage case we check the
    uptodate bitmap of btrfs_subpage structure.
    
    To make the check more elegant, introduce a helper,
    assert_eb_page_uptodate() to do the check for both subpage and regular
    sector size cases.
    
    The following functions are involved:
    
    - write_extent_buffer_chunk_tree_uuid()
    - write_extent_buffer_fsid()
    - write_extent_buffer()
    - memzero_extent_buffer()
    - copy_extent_buffer()
    - extent_buffer_test_bit()
    - extent_buffer_bitmap_set()
    - extent_buffer_bitmap_clear()
    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>
    b8f95771
extent_io.c 177 KB