diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-01-18 21:19:38 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-15 16:11:50 +0200 |
commit | dee81d5111ff0e24ac63ab0dbbd19e84c2f87904 (patch) | |
tree | d6199ff2f563422fc6b79be2bc718e165113a738 /block/mirror.c | |
parent | 18bb69287ea522ab696e1bea818b93e5eaa85745 (diff) |
blockjob: Introduce block_job_ratelimit_get_delay()
This gets us rid of more direct accesses to BlockJob fields from the
job drivers.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/mirror.c b/block/mirror.c index 6955d68804..6aa38db114 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -447,10 +447,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) assert(io_bytes); offset += io_bytes; nb_chunks -= DIV_ROUND_UP(io_bytes, s->granularity); - if (s->common.speed) { - delay_ns = ratelimit_calculate_delay(&s->common.limit, - io_bytes_acct); - } + delay_ns = block_job_ratelimit_get_delay(&s->common, io_bytes_acct); } return delay_ns; } |