提交 f0e97360 编写于 作者: F Fam Zheng 提交者: Kevin Wolf

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: NFam Zheng <famz@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 7db1689c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册