Skip to content

Commit a7f3b7f

Browse files
committed
blockjob: rename block_job_is_paused()
The block_job_is_paused() function name is not great because callers only use it to determine whether pausing has been requested. Rename it to highlight those semantics and remove it from the public header file as there are no external callers. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1466096189-6477-3-git-send-email-stefanha@redhat.com
1 parent 17bd51f commit a7f3b7f

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

blockjob.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void block_job_pause(BlockJob *job)
252252
job->pause_count++;
253253
}
254254

255-
bool block_job_is_paused(BlockJob *job)
255+
static bool block_job_should_pause(BlockJob *job)
256256
{
257257
return job->pause_count > 0;
258258
}
@@ -361,11 +361,11 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns)
361361
}
362362

363363
job->busy = false;
364-
if (!block_job_is_paused(job)) {
364+
if (!block_job_should_pause(job)) {
365365
co_aio_sleep_ns(blk_get_aio_context(job->blk), type, ns);
366366
}
367367
/* The job can be paused while sleeping, so check this again */
368-
if (block_job_is_paused(job)) {
368+
if (block_job_should_pause(job)) {
369369
qemu_coroutine_yield();
370370
}
371371
job->busy = true;

include/block/blockjob.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,6 @@ void block_job_event_completed(BlockJob *job, const char *msg);
347347
*/
348348
void block_job_event_ready(BlockJob *job);
349349

350-
/**
351-
* block_job_is_paused:
352-
* @job: The job being queried.
353-
*
354-
* Returns whether the job is currently paused, or will pause
355-
* as soon as it reaches a sleeping point.
356-
*/
357-
bool block_job_is_paused(BlockJob *job);
358-
359350
/**
360351
* block_job_cancel_sync:
361352
* @job: The job to be canceled.

0 commit comments

Comments
 (0)