diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-02-03 16:22:00 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-02-23 19:49:30 +0100 |
commit | 48aef7944090fdddd6a89e07b790798cf31b56a4 (patch) | |
tree | df5fb4667741e61700e0d0ff0f24ed743a89ff87 /include/block | |
parent | d9249c253c28ef836641bea98180784fc2e9f655 (diff) | |
download | qemu-48aef7944090fdddd6a89e07b790798cf31b56a4.zip qemu-48aef7944090fdddd6a89e07b790798cf31b56a4.tar.gz qemu-48aef7944090fdddd6a89e07b790798cf31b56a4.tar.bz2 |
block: Mark bdrv_co_delete_file() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_delete_file() need to hold a reader lock for the graph.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230203152202.49054-22-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block-io.h | 8 | ||||
-rw-r--r-- | include/block/block_int-common.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/include/block/block-io.h b/include/block/block-io.h index bf27480..a195a9f 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -90,8 +90,12 @@ int64_t co_wrapper bdrv_get_allocated_file_size(BlockDriverState *bs); BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts, BlockDriverState *in_bs, Error **errp); void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr); -int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp); -void coroutine_fn bdrv_co_delete_file_noerr(BlockDriverState *bs); + +int coroutine_fn GRAPH_RDLOCK +bdrv_co_delete_file(BlockDriverState *bs, Error **errp); + +void coroutine_fn GRAPH_RDLOCK +bdrv_co_delete_file_noerr(BlockDriverState *bs); /* async block I/O */ diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 88d9897..257a9d1 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -649,8 +649,8 @@ struct BlockDriver { int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_flush)(BlockDriverState *bs); /* Delete a created file. */ - int coroutine_fn (*bdrv_co_delete_file)(BlockDriverState *bs, - Error **errp); + int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_delete_file)( + BlockDriverState *bs, Error **errp); /* * Flushes all data that was already written to the OS all the way down to |