• Johannes Thumshirn's avatar
    btrfs: document extent mapping assumptions in checksum · d2e174d5
    Johannes Thumshirn authored
    Document why map_private_extent_buffer() cannot return '1' (i.e. the map
    spans two pages) for the csum_tree_block() case.
    
    The current algorithm for detecting a page boundary crossing in
    map_private_extent_buffer() will return a '1' *IFF* the extent buffer's
    offset in the page + the offset passed in by csum_tree_block() and the
    minimal length passed in by csum_tree_block() - 1 are bigger than
    PAGE_SIZE.
    
    We always pass BTRFS_CSUM_SIZE (32) as offset and a minimal length of 32
    and the current extent buffer allocator always guarantees page aligned
    extends, so the above condition can't be true.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    d2e174d5
disk-io.c 124 KB