aboutsummaryrefslogtreecommitdiff
path: root/block/blklogwrites.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-02-03 16:21:50 +0100
committerKevin Wolf <kwolf@redhat.com>2023-02-23 19:49:17 +0100
commitb9b10c35e5c8bdb800601b142c44a4bd2da5a6d2 (patch)
treed0f692507ec8ea696ecea07c1aae59a839568795 /block/blklogwrites.c
parent7b1fb72e2c1b9fbca17c13b753aee25f445cad24 (diff)
block: Mark public read/write functions GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_pread*/pwrite*() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. These places will be removed once everything is properly annotated. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230203152202.49054-12-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/blklogwrites.c')
-rw-r--r--block/blklogwrites.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index bdaa2a57a2..93086c31e1 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -294,7 +294,7 @@ static void blk_log_writes_refresh_limits(BlockDriverState *bs, Error **errp)
bs->bl.request_alignment = s->sectorsize;
}
-static int coroutine_fn
+static int coroutine_fn GRAPH_RDLOCK
blk_log_writes_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes,
QEMUIOVector *qiov, BdrvRequestFlags flags)
{
@@ -430,7 +430,7 @@ blk_log_writes_co_log(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
return fr.file_ret;
}
-static int coroutine_fn
+static int coroutine_fn GRAPH_RDLOCK
blk_log_writes_co_do_file_pwritev(BlkLogWritesFileReq *fr)
{
return bdrv_co_pwritev(fr->bs->file, fr->offset, fr->bytes,
@@ -456,11 +456,10 @@ blk_log_writes_co_do_file_pdiscard(BlkLogWritesFileReq *fr)
return bdrv_co_pdiscard(fr->bs->file, fr->offset, fr->bytes);
}
-static int coroutine_fn
+static int coroutine_fn GRAPH_RDLOCK
blk_log_writes_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes,
QEMUIOVector *qiov, BdrvRequestFlags flags)
{
- assume_graph_lock(); /* FIXME */
return blk_log_writes_co_log(bs, offset, bytes, qiov, flags,
blk_log_writes_co_do_file_pwritev, 0, false);
}