]> git.proxmox.com Git - mirror_qemu.git/commit
block: Make bdrv_round_to_clusters() signature more useful
authorEric Blake <eblake@redhat.com>
Thu, 12 Oct 2017 03:46:59 +0000 (22:46 -0500)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Oct 2017 12:45:57 +0000 (14:45 +0200)
commit7cfd527525a7d6b1c904890a6b84c1227846415e
tree55d25498a379476b045ac7c681387cf759babfd8
parentc9ce8c4da65b0c2b1dc82cbf2328ff3e23d76943
block: Make bdrv_round_to_clusters() signature more useful

In the process of converting sector-based interfaces to bytes,
I'm finding it easier to represent a byte count as a 64-bit
integer at the block layer (even if we are internally capped
by SIZE_MAX or even INT_MAX for individual transactions, it's
still nicer to not have to worry about truncation/overflow
issues on as many variables).  Update the signature of
bdrv_round_to_clusters() to uniformly use int64_t, matching
the signature already chosen for bdrv_is_allocated and the
fact that off_t is also a signed type, then adjust clients
according to the required fallout (even where the result could
now exceed 32 bits, no client is directly assigning the result
into a 32-bit value without breaking things into a loop first).

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c
block/mirror.c
block/trace-events
include/block/block.h