Commit 86b1309c7e411b7c25dc0dc7a092582a4d291044

Authored by Pravin B Shelar
Committed by Jesse Gross
1 parent 263ba61d3b

genetlink: Add lockdep_genl_is_held().

Open vSwitch uses genl_mutex locking to protect datapath
data-structures like flow-table, flow-actions. Following patch adds
lockdep_genl_is_held() which is used for rcu annotation to prove
locking.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>

Showing 2 changed files with 11 additions and 0 deletions Side-by-side Diff

include/linux/genetlink.h
... ... @@ -85,6 +85,9 @@
85 85 /* All generic netlink requests are serialized by a global lock. */
86 86 extern void genl_lock(void);
87 87 extern void genl_unlock(void);
  88 +#ifdef CONFIG_PROVE_LOCKING
  89 +extern int lockdep_genl_is_held(void);
  90 +#endif
88 91  
89 92 #endif /* __KERNEL__ */
90 93  
net/netlink/genetlink.c
... ... @@ -33,6 +33,14 @@
33 33 }
34 34 EXPORT_SYMBOL(genl_unlock);
35 35  
  36 +#ifdef CONFIG_PROVE_LOCKING
  37 +int lockdep_genl_is_held(void)
  38 +{
  39 + return lockdep_is_held(&genl_mutex);
  40 +}
  41 +EXPORT_SYMBOL(lockdep_genl_is_held);
  42 +#endif
  43 +
36 44 #define GENL_FAM_TAB_SIZE 16
37 45 #define GENL_FAM_TAB_MASK (GENL_FAM_TAB_SIZE - 1)
38 46