From cefbc0d19bbfb14776078359c4a67442b0849803 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 25 Apr 2020 21:41:09 +0000 Subject: [PATCH] Add g_topology_locked() macro that returns true if we already hold the GEOM topology lock. --- sys/geom/geom.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 0580080ca1e6..e506bf6ae8a5 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -395,6 +395,8 @@ g_free(void *ptr) sx_xunlock(&topology_lock); \ } while (0) +#define g_topology_locked() sx_xlocked(&topology_lock) + #define g_topology_assert() \ do { \ sx_assert(&topology_lock, SX_XLOCKED); \