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>
This commit is contained in:
parent
d9249c253c
commit
48aef79440
1
block.c
1
block.c
@ -740,6 +740,7 @@ int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs, Error **errp)
|
|||||||
|
|
||||||
IO_CODE();
|
IO_CODE();
|
||||||
assert(bs != NULL);
|
assert(bs != NULL);
|
||||||
|
assert_bdrv_graph_readable();
|
||||||
|
|
||||||
if (!bs->drv) {
|
if (!bs->drv) {
|
||||||
error_setg(errp, "Block node '%s' is not opened", bs->filename);
|
error_setg(errp, "Block node '%s' is not opened", bs->filename);
|
||||||
|
@ -90,8 +90,12 @@ int64_t co_wrapper bdrv_get_allocated_file_size(BlockDriverState *bs);
|
|||||||
BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts,
|
BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts,
|
||||||
BlockDriverState *in_bs, Error **errp);
|
BlockDriverState *in_bs, Error **errp);
|
||||||
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
|
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 */
|
/* async block I/O */
|
||||||
|
@ -649,8 +649,8 @@ struct BlockDriver {
|
|||||||
int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_flush)(BlockDriverState *bs);
|
int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_flush)(BlockDriverState *bs);
|
||||||
|
|
||||||
/* Delete a created file. */
|
/* Delete a created file. */
|
||||||
int coroutine_fn (*bdrv_co_delete_file)(BlockDriverState *bs,
|
int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_delete_file)(
|
||||||
Error **errp);
|
BlockDriverState *bs, Error **errp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flushes all data that was already written to the OS all the way down to
|
* Flushes all data that was already written to the OS all the way down to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user