diff options
author | Fam Zheng <famz@redhat.com> | 2014-04-28 10:59:28 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-04-28 17:36:30 +0200 |
commit | f0e973601250a3f1579ff77230c419c562958fa8 (patch) | |
tree | f53946ceadb64ac9bcacb9ff4b6fe5b94901bbae /block/mirror.c | |
parent | 7db1689c35a6f7477c691c31232ec10725ba9dfe (diff) | |
download | qemu-f0e973601250a3f1579ff77230c419c562958fa8.zip qemu-f0e973601250a3f1579ff77230c419c562958fa8.tar.gz qemu-f0e973601250a3f1579ff77230c419c562958fa8.tar.bz2 |
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>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c index 36f4f8e..95366ad 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -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 |