diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 730899ce5162..03684e702d13 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -746,6 +746,25 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size) | |||
746 | */ | 746 | */ |
747 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) | 747 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) |
748 | 748 | ||
749 | /* | ||
750 | * Macro so as to not evaluate some arguments when | ||
751 | * lockdep is not enabled. | ||
752 | * | ||
753 | * Mark both the sk_lock and the sk_lock.slock as a | ||
754 | * per-address-family lock class. | ||
755 | */ | ||
756 | #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ | ||
757 | do { \ | ||
758 | sk->sk_lock.owner = NULL; \ | ||
759 | init_waitqueue_head(&sk->sk_lock.wq); \ | ||
760 | spin_lock_init(&(sk)->sk_lock.slock); \ | ||
761 | debug_check_no_locks_freed((void *)&(sk)->sk_lock, \ | ||
762 | sizeof((sk)->sk_lock)); \ | ||
763 | lockdep_set_class_and_name(&(sk)->sk_lock.slock, \ | ||
764 | (skey), (sname)); \ | ||
765 | lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \ | ||
766 | } while (0) | ||
767 | |||
749 | extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass)); | 768 | extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass)); |
750 | 769 | ||
751 | static inline void lock_sock(struct sock *sk) | 770 | static inline void lock_sock(struct sock *sk) |