X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=include%2Fblock%2Fgraph-lock.h;h=22b5db1ed962f9bf5dd4d8a3d661d7b5dcde7b0e;hb=6bc0bcc89f847839cf3d459a55290dda8801d9d3;hp=7574a2de5b162bfe02a456a7848f04b3b405b397;hpb=caa9cbd566877b34e9abcc04d936116fc5e0ab28;p=mirror_qemu.git diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h index 7574a2de5b..22b5db1ed9 100644 --- a/include/block/graph-lock.h +++ b/include/block/graph-lock.h @@ -111,17 +111,33 @@ void unregister_aiocontext(AioContext *ctx); * The wrlock can only be taken from the main loop, with BQL held, as only the * main loop is allowed to modify the graph. * + * If @bs is non-NULL, its AioContext is temporarily released. + * * This function polls. Callers must not hold the lock of any AioContext other - * than the current one. + * than the current one and the one of @bs. */ -void bdrv_graph_wrlock(void) TSA_ACQUIRE(graph_lock) TSA_NO_TSA; +void no_coroutine_fn TSA_ACQUIRE(graph_lock) TSA_NO_TSA +bdrv_graph_wrlock(BlockDriverState *bs); /* * bdrv_graph_wrunlock: * Write finished, reset global has_writer to 0 and restart * all readers that are waiting. + * + * If @bs is non-NULL, its AioContext is temporarily released. + */ +void no_coroutine_fn TSA_RELEASE(graph_lock) TSA_NO_TSA +bdrv_graph_wrunlock(BlockDriverState *bs); + +/* + * bdrv_graph_wrunlock_ctx: + * Write finished, reset global has_writer to 0 and restart + * all readers that are waiting. + * + * If @ctx is non-NULL, its lock is temporarily released. */ -void bdrv_graph_wrunlock(void) TSA_RELEASE(graph_lock) TSA_NO_TSA; +void no_coroutine_fn TSA_RELEASE(graph_lock) TSA_NO_TSA +bdrv_graph_wrunlock_ctx(AioContext *ctx); /* * bdrv_graph_co_rdlock: