From 30a5c887bf4a7e00d0e0ecbb08509e8ba2902620 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 4 May 2018 12:17:20 +0200 Subject: job: Move progress fields to Job BlockJob has fields .offset and .len, which are actually misnomers today because they are no longer tied to block device sizes, but just progress counters. As such they make a lot of sense in generic Jobs. This patch moves the fields to Job and renames them to .progress_current and .progress_total to describe their function better. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- job.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'job.c') diff --git a/job.c b/job.c index b5bd51b0ad..2046d2f9d3 100644 --- a/job.c +++ b/job.c @@ -364,6 +364,16 @@ void job_unref(Job *job) } } +void job_progress_update(Job *job, uint64_t done) +{ + job->progress_current += done; +} + +void job_progress_set_remaining(Job *job, uint64_t remaining) +{ + job->progress_total = job->progress_current + remaining; +} + void job_event_cancelled(Job *job) { notifier_list_notify(&job->on_finalize_cancelled, job); -- cgit v1.2.3