Message ID | 20180509162637.15575-8-kwolf@redhat.com |
---|---|
State | New |
Headers | show |
Series | Generic background jobs | expand |
On 05/09/2018 11:26 AM, Kevin Wolf wrote: > Commit 81193349 removed the only use of block_job_pause/resume_all(), > which was in bdrv_drain_all(). The functions are now unused and can be > removed. > > Signed-off-by: Kevin Wolf <kwolf@redhat.com> > --- > include/block/blockjob_int.h | 14 -------------- > blockjob.c | 27 --------------------------- > 2 files changed, 41 deletions(-) Reviewed-by: Eric Blake <eblake@redhat.com>
On 2018-05-09 18:26, Kevin Wolf wrote: > Commit 81193349 removed the only use of block_job_pause/resume_all(), > which was in bdrv_drain_all(). The functions are now unused and can be > removed. I have a strange liking for all-digit commit hash prefixes. > Signed-off-by: Kevin Wolf <kwolf@redhat.com> > --- > include/block/blockjob_int.h | 14 -------------- > blockjob.c | 27 --------------------------- > 2 files changed, 41 deletions(-) Reviewed-by: Max Reitz <mreitz@redhat.com>
On 05/11/2018 06:30 PM, Max Reitz wrote: > On 2018-05-09 18:26, Kevin Wolf wrote: >> Commit 81193349 removed the only use of block_job_pause/resume_all(), >> which was in bdrv_drain_all(). The functions are now unused and can be >> removed. > > I have a strange liking for all-digit commit hash prefixes. > >> Signed-off-by: Kevin Wolf <kwolf@redhat.com> >> --- >> include/block/blockjob_int.h | 14 -------------- >> blockjob.c | 27 --------------------------- >> 2 files changed, 41 deletions(-) > And all deletion diffstats. > Reviewed-by: Max Reitz <mreitz@redhat.com> > Reviewed-by: John Snow <jsnow@redhat.com>
On 05/11/2018 05:30 PM, Max Reitz wrote: > On 2018-05-09 18:26, Kevin Wolf wrote: >> Commit 81193349 removed the only use of block_job_pause/resume_all(), >> which was in bdrv_drain_all(). The functions are now unused and can be >> removed. > > I have a strange liking for all-digit commit hash prefixes. Especially when the first digit is 0, but then the rest includes an 8 or 9. (in the past, I've actually had a script transiently break when parsing commit ids, and it took me quite a while to figure out why the problem disappeared after I rebased, until I finally realized that it was because the script was choking on an attempt to parse an invalid octal number, only when I got lucky enough to land on a problematic commit id)
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 4d0439c51e..62ec964d09 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -174,20 +174,6 @@ void block_job_yield(BlockJob *job); int64_t block_job_ratelimit_get_delay(BlockJob *job, uint64_t n); /** - * block_job_pause_all: - * - * Asynchronously pause all jobs. - */ -void block_job_pause_all(void); - -/** - * block_job_resume_all: - * - * Resume all block jobs. Must be paired with a preceding block_job_pause_all. - */ -void block_job_resume_all(void); - -/** * block_job_early_fail: * @bs: The block device. * diff --git a/blockjob.c b/blockjob.c index 985621e256..9943218a34 100644 --- a/blockjob.c +++ b/blockjob.c @@ -1010,19 +1010,6 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, return job; } -void block_job_pause_all(void) -{ - BlockJob *job = NULL; - while ((job = block_job_next(job))) { - AioContext *aio_context = blk_get_aio_context(job->blk); - - aio_context_acquire(aio_context); - block_job_ref(job); - block_job_pause(job); - aio_context_release(aio_context); - } -} - void block_job_early_fail(BlockJob *job) { assert(job->status == BLOCK_JOB_STATUS_CREATED); @@ -1100,20 +1087,6 @@ void coroutine_fn block_job_pause_point(BlockJob *job) } } -void block_job_resume_all(void) -{ - BlockJob *job, *next; - - QLIST_FOREACH_SAFE(job, &block_jobs, job_list, next) { - AioContext *aio_context = blk_get_aio_context(job->blk); - - aio_context_acquire(aio_context); - block_job_resume(job); - block_job_unref(job); - aio_context_release(aio_context); - } -} - /* * Conditionally enter a block_job pending a call to fn() while * under the block_job_lock critical section.
Commit 81193349 removed the only use of block_job_pause/resume_all(), which was in bdrv_drain_all(). The functions are now unused and can be removed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- include/block/blockjob_int.h | 14 -------------- blockjob.c | 27 --------------------------- 2 files changed, 41 deletions(-)