Skip to content
  • Mike Snitzer's avatar
    dm thin: support for non power of 2 pool blocksize · 55f2b8bd
    Mike Snitzer authored
    
    
    Non power of 2 blocksize support is needed to properly align thinp IO
    on storage that has non power of 2 optimal IO sizes (e.g. RAID6 10+2).
    
    Use sector_div to support non power of 2 blocksize for the pool's
    data device.  This provides comparable performance to the power of 2
    math that was performed until now (as tested on modern x86_64 hardware).
    
    The kernel currently assumes that limits->discard_granularity is a power
    of two so the thin target only enables discard support if the block
    size is a power of two.
    
    Eliminate pool structure's 'block_shift', 'offset_mask' and
    remaining 4 byte holes.
    
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    55f2b8bd