提交 e3980e28 编写于 作者: D Dietmar Maurer 提交者: Kevin Wolf

stream: fix ratelimit_set_speed

The formula to compute slice_quota was wrong since commit 6ef228fc.
Signed-off-by: NDietmar Maurer <dietmar@proxmox.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 0c6f08b0
......@@ -42,7 +42,7 @@ static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed,
uint64_t slice_ns)
{
limit->slice_ns = slice_ns;
limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns;
limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL;
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册