• A
    qcow2: Use unsigned int for both members of Qcow2COWRegion · e034f5bc
    Alberto Garcia 提交于
    Qcow2COWRegion has two attributes:
    
    - The offset of the COW region from the start of the first cluster
      touched by the I/O request. Since it's always going to be positive
      and the maximum request size is at most INT_MAX, we can use a
      regular unsigned int to store this offset.
    
    - The size of the COW region in bytes. This is guaranteed to be >= 0,
      so we should use an unsigned type instead.
    
    In x86_64 this reduces the size of Qcow2COWRegion from 16 to 8 bytes.
    It will also help keep some assertions simpler now that we know that
    there are no negative numbers.
    
    The prototype of do_perform_cow() is also updated to reflect these
    changes.
    Signed-off-by: NAlberto Garcia <berto@igalia.com>
    Reviewed-by: NEric Blake <eblake@redhat.com>
    Reviewed-by: NKevin Wolf <kwolf@redhat.com>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    e034f5bc
qcow2-cluster.c 62.0 KB