From 004e95df98266da33e08c9f1731aca71b6d6d7c4 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 20 Apr 2018 14:56:08 +0200 Subject: job: Convert block_job_cancel_async() to Job block_job_cancel_async() did two things that were still block job specific: * Setting job->force. This field makes sense on the Job level, so we can just move it. While at it, rename it to job->force_cancel to make its purpose more obvious. * Resetting the I/O status. This can't be moved because generic Jobs don't have an I/O status. What the function really implements is a user resume, except without entering the coroutine. Consequently, it makes sense to call the .user_resume driver callback here which already resets the I/O status. The old block_job_cancel_async() has two separate if statements that check job->iostatus != BLOCK_DEVICE_IO_STATUS_OK and job->user_paused. However, the former condition always implies the latter (as is asserted in block_job_iostatus_reset()), so changing the explicit call of block_job_iostatus_reset() on the former condition with the .user_resume callback on the latter condition is equivalent and doesn't need to access any BlockJob specific state. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- include/block/blockjob.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/block/blockjob.h') diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 3f405d1..d975efe 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -51,12 +51,6 @@ typedef struct BlockJob { BlockBackend *blk; /** - * Set to true if the job should abort immediately without waiting - * for data to be in sync. - */ - bool force; - - /** * Set to true when the job is ready to be completed. */ bool ready; -- cgit v1.1