• Qu Wenruo's avatar
    btrfs: fix a compilation error if DEBUG is defined in btree_dirty_folio · 5e0e8799
    Qu Wenruo authored
    [BUG]
    After commit 72a69cd0 ("btrfs: subpage: pack all subpage bitmaps
    into a larger bitmap"), the DEBUG section of btree_dirty_folio() would
    no longer compile.
    
    [CAUSE]
    If DEBUG is defined, we would do extra checks for btree_dirty_folio(),
    mostly to make sure the range we marked dirty has an extent buffer and
    that extent buffer is dirty.
    
    For subpage, we need to iterate through all the extent buffers covered
    by that page range, and make sure they all matches the criteria.
    
    However commit 72a69cd0 ("btrfs: subpage: pack all subpage bitmaps
    into a larger bitmap") changes how we store the bitmap, we pack all the
    16 bits bitmaps into a larger bitmap, which would save some space.
    
    This means we no longer have btrfs_subpage::dirty_bitmap, instead the
    dirty bitmap is starting at btrfs_subpage_info::dirty_offset, and has a
    length of btrfs_subpage_info::bitmap_nr_bits.
    
    [FIX]
    Although I'm not sure if it still makes sense to maintain such code, at
    least let it compile.
    
    This patch would let us test the bits one by one through the bitmaps.
    
    CC: stable@vger.kernel.org # 6.1+
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    5e0e8799
disk-io.c 139 KB