[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/28] graph-lock: Add GRAPH_UNLOCKED(_PTR)
From: |
Kevin Wolf |
Subject: |
[PULL 13/28] graph-lock: Add GRAPH_UNLOCKED(_PTR) |
Date: |
Wed, 10 May 2023 14:20:56 +0200 |
For some functions, it is part of their interface to be called without
holding the graph lock. Add a new macro to document this.
The macro expands to TSA_EXCLUDES(), which is a relatively weak check
because it passes in cases where the compiler just doesn't know if the
lock is held. Function pointers can't be checked at all. Therefore, its
primary purpose is documentation.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230504115750.54437-7-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/block/graph-lock.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h
index ac0fef8605..f17d1588e7 100644
--- a/include/block/graph-lock.h
+++ b/include/block/graph-lock.h
@@ -73,6 +73,7 @@ extern BdrvGraphLock graph_lock;
*/
#define GRAPH_WRLOCK TSA_REQUIRES(graph_lock)
#define GRAPH_RDLOCK TSA_REQUIRES_SHARED(graph_lock)
+#define GRAPH_UNLOCKED TSA_EXCLUDES(graph_lock)
/*
* TSA annotations are not part of function types, so checks are defeated when
@@ -83,6 +84,7 @@ extern BdrvGraphLock graph_lock;
*/
#define GRAPH_RDLOCK_PTR TSA_GUARDED_BY(graph_lock)
#define GRAPH_WRLOCK_PTR TSA_GUARDED_BY(graph_lock)
+#define GRAPH_UNLOCKED_PTR
/*
* register_aiocontext:
--
2.40.1
- [PULL 07/28] qcow2: Don't call bdrv_getlength() in coroutine_fns, (continued)
- [PULL 07/28] qcow2: Don't call bdrv_getlength() in coroutine_fns, Kevin Wolf, 2023/05/10
- [PULL 04/28] block: Fix use after free in blockdev_mark_auto_del(), Kevin Wolf, 2023/05/10
- [PULL 05/28] iotests/nbd-reconnect-on-open: Fix NBD socket path, Kevin Wolf, 2023/05/10
- [PULL 06/28] migration: Attempt disk reactivation in more failure scenarios, Kevin Wolf, 2023/05/10
- [PULL 08/28] block: Consistently call bdrv_activate() outside coroutine, Kevin Wolf, 2023/05/10
- [PULL 12/28] test-bdrv-drain: Don't modify the graph in coroutines, Kevin Wolf, 2023/05/10
- [PULL 15/28] block: .bdrv_open is non-coroutine and unlocked, Kevin Wolf, 2023/05/10
- [PULL 10/28] block: Don't call no_coroutine_fns in qmp_block_resize(), Kevin Wolf, 2023/05/10
- [PULL 11/28] iotests: Test resizing image attached to an iothread, Kevin Wolf, 2023/05/10
- [PULL 14/28] graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lock, Kevin Wolf, 2023/05/10
- [PULL 13/28] graph-lock: Add GRAPH_UNLOCKED(_PTR),
Kevin Wolf <=
- [PULL 16/28] nbd: Remove nbd_co_flush() wrapper function, Kevin Wolf, 2023/05/10
- [PULL 20/28] block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/10
- [PULL 09/28] block: bdrv/blk_co_unref() for calls in coroutine context, Kevin Wolf, 2023/05/10
- [PULL 18/28] vhdx: Require GRAPH_RDLOCK for accessing a node's parent list, Kevin Wolf, 2023/05/10
- [PULL 19/28] mirror: Require GRAPH_RDLOCK for accessing a node's parent list, Kevin Wolf, 2023/05/10
- [PULL 23/28] block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK, Kevin Wolf, 2023/05/10
- [PULL 22/28] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK, Kevin Wolf, 2023/05/10