Skip to content
  • Mikulas Patocka's avatar
    dm thin: optimize power of two block size · f9a8e0cd
    Mikulas Patocka authored
    
    
    dm-thin will be most likely used with a block size that is a power of
    two. So it should be optimized for this case.
    
    This patch changes division and modulo operations to shifts and bit
    masks if block size is a power of two.
    
    A test that bi_sector is divisible by a block size is removed from
    io_overlaps_block. Device mapper never sends bios that span a block
    boundary. Consequently, if we tested that bi_size is equivalent to block
    size, bi_sector must already be on a block boundary.
    
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    f9a8e0cd