]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
jump_label: Define guard() for jump_label_lock
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 9 Dec 2024 02:41:11 +0000 (11:41 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 10 Jan 2025 00:00:13 +0000 (09:00 +0900)
Link: https://lore.kernel.org/all/173371207108.480397.12818384744149153972.stgit@devnote2/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
include/linux/jump_label.h

index f5a2727ca4a9a9a8d675656632cfad4ff045c231..fdb79dd1ebd8c4e79bc03068393fed27ca8a6e05 100644 (file)
@@ -75,6 +75,7 @@
 
 #include <linux/types.h>
 #include <linux/compiler.h>
+#include <linux/cleanup.h>
 
 extern bool static_key_initialized;
 
@@ -347,6 +348,8 @@ static inline void static_key_disable(struct static_key *key)
 
 #endif /* CONFIG_JUMP_LABEL */
 
+DEFINE_LOCK_GUARD_0(jump_label_lock, jump_label_lock(), jump_label_unlock())
+
 #define STATIC_KEY_INIT STATIC_KEY_INIT_FALSE
 #define jump_label_enabled static_key_enabled