diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 0969fb60d6ea..324b3ea233d6 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/timer.h> | 44 | #include <linux/timer.h> |
45 | #include <linux/cache.h> | 45 | #include <linux/cache.h> |
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/lockdep.h> | ||
47 | #include <linux/netdevice.h> | 48 | #include <linux/netdevice.h> |
48 | #include <linux/skbuff.h> /* struct sk_buff */ | 49 | #include <linux/skbuff.h> /* struct sk_buff */ |
49 | #include <linux/security.h> | 50 | #include <linux/security.h> |
@@ -78,18 +79,17 @@ typedef struct { | |||
78 | spinlock_t slock; | 79 | spinlock_t slock; |
79 | struct sock_iocb *owner; | 80 | struct sock_iocb *owner; |
80 | wait_queue_head_t wq; | 81 | wait_queue_head_t wq; |
82 | /* | ||
83 | * We express the mutex-alike socket_lock semantics | ||
84 | * to the lock validator by explicitly managing | ||
85 | * the slock as a lock variant (in addition to | ||
86 | * the slock itself): | ||
87 | */ | ||
88 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
89 | struct lockdep_map dep_map; | ||
90 | #endif | ||
81 | } socket_lock_t; | 91 | } socket_lock_t; |
82 | 92 | ||
83 | extern struct lock_class_key af_family_keys[AF_MAX]; | ||
84 | |||
85 | #define sock_lock_init(__sk) \ | ||
86 | do { spin_lock_init(&((__sk)->sk_lock.slock)); \ | ||
87 | lockdep_set_class(&(__sk)->sk_lock.slock, \ | ||
88 | af_family_keys + (__sk)->sk_family); \ | ||
89 | (__sk)->sk_lock.owner = NULL; \ | ||
90 | init_waitqueue_head(&((__sk)->sk_lock.wq)); \ | ||
91 | } while(0) | ||
92 | |||
93 | struct sock; | 93 | struct sock; |
94 | struct proto; | 94 | struct proto; |
95 | 95 | ||