diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 13:13:03 -0400 | 
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 13:13:03 -0400 | 
| commit | 5e66dd6d66ffe758b39b6dcadf2330753ee1159b (patch) | |
| tree | a72cdcff4448e4af9425cc213ddf56ab23e697fe /net/unix/af_unix.c | |
| parent | 026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (diff) | |
| parent | ca78f6baca863afe2e6a244a0fe94b3a70211d46 (diff) | |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'net/unix/af_unix.c')
| -rw-r--r-- | net/unix/af_unix.c | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index aca650109425..f70475bfb62a 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -144,7 +144,7 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)  	scm->seclen = *UNIXSECLEN(skb);  }  #else -static void unix_get_peersec_dgram(struct sk_buff *skb) +static inline void unix_get_peersec_dgram(struct sk_buff *skb)  { }  static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb) @@ -565,6 +565,14 @@ static struct proto unix_proto = {  	.obj_size = sizeof(struct unix_sock),  }; +/* + * AF_UNIX sockets do not interact with hardware, hence they + * dont trigger interrupts - so it's safe for them to have + * bh-unsafe locking for their sk_receive_queue.lock. Split off + * this special lock-class by reinitializing the spinlock key: + */ +static struct lock_class_key af_unix_sk_receive_queue_lock_key; +  static struct sock * unix_create1(struct socket *sock)  {  	struct sock *sk = NULL; @@ -580,6 +588,8 @@ static struct sock * unix_create1(struct socket *sock)  	atomic_inc(&unix_nr_socks);  	sock_init_data(sock,sk); +	lockdep_set_class(&sk->sk_receive_queue.lock, +				&af_unix_sk_receive_queue_lock_key);  	sk->sk_write_space	= unix_write_space;  	sk->sk_max_ack_backlog	= sysctl_unix_max_dgram_qlen; @@ -1045,7 +1055,7 @@ restart:  		goto out_unlock;  	} -	unix_state_wlock(sk); +	unix_state_wlock_nested(sk);  	if (sk->sk_state != st) {  		unix_state_wunlock(sk); | 
