From: Fam Zheng Date: Mon, 28 Apr 2014 02:59:28 +0000 (+0800) Subject: mirror: Use DIV_ROUND_UP X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~872^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0e973601250a3f1579ff77230c419c562958fa8;p=sdk%2Femulator%2Fqemu.git 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 Signed-off-by: Kevin Wolf --- 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