From 3d70ff53b6bf90d9eec6f97024ec9895f6799d9e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 24 Apr 2018 16:13:52 +0200 Subject: job: Move completion and cancellation to Job This moves the top-level job completion and cancellation functions from BlockJob to Job. Signed-off-by: Kevin Wolf --- include/block/blockjob.h | 55 -------------------------------------------- include/block/blockjob_int.h | 18 --------------- 2 files changed, 73 deletions(-) (limited to 'include/block') diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 09e6bb42bf..e9ed7b8b78 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -140,15 +140,6 @@ void block_job_remove_all_bdrv(BlockJob *job); */ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp); -/** - * block_job_cancel: - * @job: The job to be canceled. - * @force: Quit a job without waiting for data to be in sync. - * - * Asynchronously cancel the specified job. - */ -void block_job_cancel(BlockJob *job, bool force); - /** * block_job_dismiss: * @job: The job to be dismissed. @@ -185,52 +176,6 @@ void block_job_progress_set_remaining(BlockJob *job, uint64_t remaining); */ BlockJobInfo *block_job_query(BlockJob *job, Error **errp); -/** - * block_job_user_cancel: - * @job: The job to be cancelled. - * @force: Quit a job without waiting for data to be in sync. - * - * Cancels the specified job, but may refuse to do so if the - * operation isn't currently meaningful. - */ -void block_job_user_cancel(BlockJob *job, bool force, Error **errp); - -/** - * block_job_cancel_sync: - * @job: The job to be canceled. - * - * Synchronously cancel the job. The completion callback is called - * before the function returns. The job may actually complete - * instead of canceling itself; the circumstances under which this - * happens depend on the kind of job that is active. - * - * Returns the return value from the job if the job actually completed - * during the call, or -ECANCELED if it was canceled. - */ -int block_job_cancel_sync(BlockJob *job); - -/** - * block_job_cancel_sync_all: - * - * Synchronously cancels all jobs using block_job_cancel_sync(). - */ -void block_job_cancel_sync_all(void); - -/** - * block_job_complete_sync: - * @job: The job to be completed. - * @errp: Error object which may be set by block_job_complete(); this is not - * necessarily set on every error, the job return value has to be - * checked as well. - * - * Synchronously complete the job. The completion callback is called before the - * function returns, unless it is NULL (which is permissible when using this - * function). - * - * Returns the return value from the job. - */ -int block_job_complete_sync(BlockJob *job, Error **errp); - /** * block_job_iostatus_reset: * @job: The job whose I/O status should be reset. diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 29a28020ac..7df07b20cf 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -123,24 +123,6 @@ void block_job_yield(BlockJob *job); */ int64_t block_job_ratelimit_get_delay(BlockJob *job, uint64_t n); -/** - * block_job_completed: - * @job: The job being completed. - * @ret: The status code. - * - * Call the completion function that was registered at creation time, and - * free @job. - */ -void block_job_completed(BlockJob *job, int ret); - -/** - * block_job_enter: - * @job: The job to enter. - * - * Continue the specified job by entering the coroutine. - */ -void block_job_enter(BlockJob *job); - /** * block_job_event_ready: * @job: The job which is now ready to be completed. -- cgit v1.2.3-55-g7522