On Tue, Apr 26, 2022 at 04:51:12AM -0400, Emanuele Giuseppe Esposito wrote:
> diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h
> index f171ba0527..2211d41286 100644
> --- a/include/block/graph-lock.h
> +++ b/include/block/graph-lock.h
> @@ -52,5 +52,20 @@ void coroutine_fn bdrv_graph_co_rdlock(void);
>   */
>  void coroutine_fn bdrv_graph_co_rdunlock(void);
>  
> +/*
> + * assert_bdrv_graph_readable:
> + * Make sure that the reader is either the main loop,
> + * or there is at least a reader helding the rdlock.
> + * In this way an incoming writer is aware of the read and waits.
> + */
> +void assert_bdrv_graph_readable(void);

The name confuses me. I suggest assert_bdrv_graph_rdlock_held().

> +
> +/*
> + * assert_bdrv_graph_writable:
> + * Make sure that the writer is the main loop and has set @has_writer,
> + * so that incoming readers will pause.
> + */
> +void assert_bdrv_graph_writable(void);

assert_bdrv_graph_wrlock_held().

> +
>  #endif /* BLOCK_LOCK_H */
>  
> -- 
> 2.31.1
> 

Attachment: signature.asc
Description: PGP signature

Reply via email to