[PATCH 1/5] maple_tree: Allow external locks to be configured with their map
Mark Brown
broonie at kernel.org
Thu Aug 22 12:13:35 PDT 2024
Currently the maple tree code allows external locks to be configured by
passing the lock itself. This is generally helpful and convenient but is
not ideal for situations like the regmap maple tree cache where we support
configurable locking at the regmap level and don't have the lock type when
we are configuring the maple tree. Add a helper that allows us to pass the
dep map directly to help with these situations. Since such code is already
peering at the lockdep internals enough to be looking at the map no stub
is provided.
Signed-off-by: Mark Brown <broonie at kernel.org>
---
include/linux/maple_tree.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index a53ad4dabd7e..bdc6b133abdc 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -193,6 +193,9 @@ typedef struct lockdep_map *lockdep_map_p;
#define mt_set_external_lock(mt, lock) \
(mt)->ma_external_lock = &(lock)->dep_map
+#define mt_set_external_lock_dep_map(mt, dep_map) \
+ (mt)->ma_external_lock = dep_map
+
#define mt_on_stack(mt) (mt).ma_external_lock = NULL
#else
typedef struct { /* nothing */ } lockdep_map_p;
--
2.39.2
More information about the maple-tree
mailing list