diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 61549b26ad6f4dd114250ac00b170a1f734fd21b..59311adfb0e013176d26b5a71c34a347852f4ce2 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h @@ -85,6 +85,9 @@ enum { /* All generic netlink requests are serialized by a global lock. */ extern void genl_lock(void); extern void genl_unlock(void); +#ifdef CONFIG_PROVE_LOCKING +extern int lockdep_genl_is_held(void); +#endif #endif /* __KERNEL__ */ diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 8a36599d35550e237b317d228b4c7839ca1e4ff7..28453ae2a97b00b85eef3b765caf64d022c13bea 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -33,6 +33,14 @@ void genl_unlock(void) } EXPORT_SYMBOL(genl_unlock); +#ifdef CONFIG_PROVE_LOCKING +int lockdep_genl_is_held(void) +{ + return lockdep_is_held(&genl_mutex); +} +EXPORT_SYMBOL(lockdep_genl_is_held); +#endif + #define GENL_FAM_TAB_SIZE 16 #define GENL_FAM_TAB_MASK (GENL_FAM_TAB_SIZE - 1)