mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] lockdep: annotate sock_lock_init()
Teach special (multi-initialized, per-address-family) locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
5436552448
commit
da21f24dd7
2 changed files with 20 additions and 0 deletions
|
@ -80,8 +80,12 @@ typedef struct {
|
|||
wait_queue_head_t wq;
|
||||
} socket_lock_t;
|
||||
|
||||
extern struct lock_class_key af_family_keys[AF_MAX];
|
||||
|
||||
#define sock_lock_init(__sk) \
|
||||
do { spin_lock_init(&((__sk)->sk_lock.slock)); \
|
||||
lockdep_set_class(&(__sk)->sk_lock.slock, \
|
||||
af_family_keys + (__sk)->sk_family); \
|
||||
(__sk)->sk_lock.owner = NULL; \
|
||||
init_waitqueue_head(&((__sk)->sk_lock.wq)); \
|
||||
} while(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue