[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR)
|
From: |
Kevin Wolf |
|
Subject: |
[PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR) |
|
Date: |
Tue, 25 Apr 2023 19:31:44 +0200 |
For some function, parts of their interface is that are 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>
---
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 18cc14de22..7ef391fab3 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.0
- [PATCH 15/20] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK, (continued)
- [PATCH 15/20] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 18/20] block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 17/20] block: Mark bdrv_query_bds_stats() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 08/20] block: .bdrv_open is non-coroutine and unlocked, Kevin Wolf, 2023/04/25
- [PATCH 16/20] block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR),
Kevin Wolf <=
- [PATCH 20/20] block: Mark bdrv_refresh_limits() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25