summaryrefslogtreecommitdiffstats
path: root/include/block/blockjob.h
diff options
context:
space:
mode:
authorKevin Wolf2018-04-13 18:50:05 +0200
committerKevin Wolf2018-05-23 14:30:49 +0200
commit80fa2c756b3241f24015a7503a01f7999d4a942d (patch)
treedb1b410af62162feb7d8b69651a9d671cf4cc030 /include/block/blockjob.h
parentjob: Move state transitions to Job (diff)
downloadqemu-80fa2c756b3241f24015a7503a01f7999d4a942d.tar.gz
qemu-80fa2c756b3241f24015a7503a01f7999d4a942d.tar.xz
qemu-80fa2c756b3241f24015a7503a01f7999d4a942d.zip
job: Add reference counting
This moves reference counting from BlockJob to Job. In order to keep calling the BlockJob cleanup code when the job is deleted via job_unref(), introduce a new JobDriver.free callback. Every block job must use block_job_free() for this callback, this is asserted in block_job_create(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include/block/blockjob.h')
-rw-r--r--include/block/blockjob.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 01cdee6d15..087e7820f5 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -132,9 +132,6 @@ typedef struct BlockJob {
/** The opaque value that is passed to the completion function. */
void *opaque;
- /** Reference count of the block job */
- int refcnt;
-
/** True when job has reported completion by calling block_job_completed. */
bool completed;
@@ -400,24 +397,6 @@ void block_job_iostatus_reset(BlockJob *job);
BlockJobTxn *block_job_txn_new(void);
/**
- * block_job_ref:
- *
- * Add a reference to BlockJob refcnt, it will be decreased with
- * block_job_unref, and then be freed if it comes to be the last
- * reference.
- */
-void block_job_ref(BlockJob *job);
-
-/**
- * block_job_unref:
- *
- * Release a reference that was previously acquired with block_job_ref
- * or block_job_create. If it's the last reference to the object, it will be
- * freed.
- */
-void block_job_unref(BlockJob *job);
-
-/**
* block_job_txn_unref:
*
* Release a reference that was previously acquired with block_job_txn_add_job