mirror of
https://github.com/qemu/qemu.git
synced 2024-11-25 03:43:37 +08:00
mirror: Use DIV_ROUND_UP
Although bdrv_getlength() was just called above this, and checked for error, it is better to just use the value we already get, and use DIV_ROUND_UP. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7db1689c35
commit
f0e9736012
@ -329,7 +329,7 @@ static void coroutine_fn mirror_run(void *opaque)
|
||||
return;
|
||||
}
|
||||
|
||||
length = (bdrv_getlength(bs) + s->granularity - 1) / s->granularity;
|
||||
length = DIV_ROUND_UP(s->common.len, s->granularity);
|
||||
s->in_flight_bitmap = bitmap_new(length);
|
||||
|
||||
/* If we have no backing file yet in the destination, we cannot let
|
||||
|
Loading…
Reference in New Issue
Block a user