Skip to content

Commit 86b1309

Browse files
Pravin B Shelarjessegross
authored andcommitted
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 <[email protected]> Signed-off-by: Jesse Gross <[email protected]>
1 parent 263ba61 commit 86b1309

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/linux/genetlink.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ enum {
8585
/* All generic netlink requests are serialized by a global lock. */
8686
extern void genl_lock(void);
8787
extern void genl_unlock(void);
88+
#ifdef CONFIG_PROVE_LOCKING
89+
extern int lockdep_genl_is_held(void);
90+
#endif
8891

8992
#endif /* __KERNEL__ */
9093

net/netlink/genetlink.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ void genl_unlock(void)
3333
}
3434
EXPORT_SYMBOL(genl_unlock);
3535

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+
3644
#define GENL_FAM_TAB_SIZE 16
3745
#define GENL_FAM_TAB_MASK (GENL_FAM_TAB_SIZE - 1)
3846

0 commit comments

Comments
 (0)