Skip to content
  • Eric Blake's avatar
    787993a5
    qcow: Switch get_cluster_offset to be byte-based · 787993a5
    Eric Blake authored
    
    
    We are gradually moving away from sector-based interfaces, towards
    byte-based.  Make the change for the internal helper function
    get_cluster_offset(), by changing n_start and n_end to be byte
    offsets rather than sector indices within the cluster being
    allocated.  However, assert that these values are still
    sector-aligned (at least qcrypto_block_encrypt() still wants that).
    For now we get that alignment for free because we still use
    sector-based driver callbacks.
    
    A later patch will then switch the qcow driver as a whole over
    to byte-based operation; but will still leave things at sector
    alignments as it is not worth auditing the qcow image format
    to worry about sub-sector requests.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    787993a5
    qcow: Switch get_cluster_offset to be byte-based
    Eric Blake authored
    
    
    We are gradually moving away from sector-based interfaces, towards
    byte-based.  Make the change for the internal helper function
    get_cluster_offset(), by changing n_start and n_end to be byte
    offsets rather than sector indices within the cluster being
    allocated.  However, assert that these values are still
    sector-aligned (at least qcrypto_block_encrypt() still wants that).
    For now we get that alignment for free because we still use
    sector-based driver callbacks.
    
    A later patch will then switch the qcow driver as a whole over
    to byte-based operation; but will still leave things at sector
    alignments as it is not worth auditing the qcow image format
    to worry about sub-sector requests.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading