Eric Blake 51b0a48888 block: Make bdrv_is_allocated_above() byte-based
We are gradually moving away from sector-based interfaces, towards
byte-based.  In the common case, allocation is unlikely to ever use
values that are not naturally sector-aligned, but it is possible
that byte-based values will let us be more precise about allocation
at the end of an unaligned file that can do byte-based access.

Changing the signature of the function to use int64_t *pnum ensures
that the compiler enforces that all callers are updated.  For now,
the io.c layer still assert()s that all callers are sector-aligned,
but that can be relaxed when a later patch implements byte-based
block status.  Therefore, for the most part this patch is just the
addition of scaling at the callers followed by inverse scaling at
bdrv_is_allocated().  But some code, particularly stream_run(),
gets a lot simpler because it no longer has to mess with sectors.
Leave comments where we can further simplify by switching to
byte-based iterations, once later patches eliminate the need for
sector-aligned operations.

For ease of review, bdrv_is_allocated() was tackled separately.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-07-10 13:18:07 +02:00
..
2016-10-07 14:14:06 +02:00
2016-10-07 14:14:06 +02:00
2017-06-26 14:51:14 +02:00
2017-07-04 14:30:03 +02:00
2017-06-22 11:34:39 +01:00
2016-11-25 13:51:30 +01:00
2016-06-07 18:19:24 +03:00
2016-01-20 13:36:23 +01:00
2017-06-20 14:31:31 +02:00
2017-05-17 12:04:59 +02:00
2016-09-23 11:42:52 +08:00
2017-05-17 12:04:59 +02:00
2017-05-17 12:04:59 +02:00
2017-07-10 13:18:05 +02:00