diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-18 16:32:20 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:50 +0200 |
commit | 5d43e86e11f488fda7956b13160e0c0105a84845 (patch) | |
tree | b5c4200538b55bb476e92b197a352ea4e3c09ce0 /block | |
parent | da01ff7f38f52791f93fc3ca59afcfbb220f15af (diff) |
job: Add job_sleep_ns()
There is nothing block layer specific about block_job_sleep_ns(), so
move the function to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/backup.c | 2 | ||||
-rw-r--r-- | block/commit.c | 2 | ||||
-rw-r--r-- | block/mirror.c | 4 | ||||
-rw-r--r-- | block/stream.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/block/backup.c b/block/backup.c index 7d9aad9749..f3a4f7c898 100644 --- a/block/backup.c +++ b/block/backup.c @@ -338,7 +338,7 @@ static bool coroutine_fn yield_and_check(BackupBlockJob *job) * return. Without a yield, the VM would not reboot. */ delay_ns = block_job_ratelimit_get_delay(&job->common, job->bytes_read); job->bytes_read = 0; - block_job_sleep_ns(&job->common, delay_ns); + job_sleep_ns(&job->common.job, delay_ns); if (job_is_cancelled(&job->common.job)) { return true; diff --git a/block/commit.c b/block/commit.c index 2fbc31077a..1c6cb6c298 100644 --- a/block/commit.c +++ b/block/commit.c @@ -172,7 +172,7 @@ static void coroutine_fn commit_run(void *opaque) /* Note that even when no rate limit is applied we need to yield * with no pending I/O here so that bdrv_drain_all() returns. */ - block_job_sleep_ns(&s->common, delay_ns); + job_sleep_ns(&s->common.job, delay_ns); if (job_is_cancelled(&s->common.job)) { break; } diff --git a/block/mirror.c b/block/mirror.c index 95fc8072b0..5d8f75c677 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -595,7 +595,7 @@ static void mirror_throttle(MirrorBlockJob *s) if (now - s->last_pause_ns > BLOCK_JOB_SLICE_TIME) { s->last_pause_ns = now; - block_job_sleep_ns(&s->common, 0); + job_sleep_ns(&s->common.job, 0); } else { job_pause_point(&s->common.job); } @@ -869,7 +869,7 @@ static void coroutine_fn mirror_run(void *opaque) cnt == 0 ? BLOCK_JOB_SLICE_TIME : 0); } trace_mirror_before_sleep(s, cnt, s->synced, delay_ns); - block_job_sleep_ns(&s->common, delay_ns); + job_sleep_ns(&s->common.job, delay_ns); if (job_is_cancelled(&s->common.job) && (!s->synced || s->common.force)) { diff --git a/block/stream.c b/block/stream.c index 6d8b7b6eee..1faab02086 100644 --- a/block/stream.c +++ b/block/stream.c @@ -140,7 +140,7 @@ static void coroutine_fn stream_run(void *opaque) /* Note that even when no rate limit is applied we need to yield * with no pending I/O here so that bdrv_drain_all() returns. */ - block_job_sleep_ns(&s->common, delay_ns); + job_sleep_ns(&s->common.job, delay_ns); if (job_is_cancelled(&s->common.job)) { break; } |