aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-06-19 01:56:42 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-19 01:56:42 -0400
commit1e061ab2e5aa50a84d68ca654773632f9c425bb6 (patch)
tree1406328bddda29edb7548dd9a43d6168cd8acc1a /net/sctp/socket.c
parente0f9f8586a0b21fb3c7a4ead3804008d57dfdef7 (diff)
[SCTP]: Replace spin_lock_irqsave with spin_lock_bh
This patch replaces the spin_lock_irqsave call on the receive queue lock in SCTP with spin_lock_bh. Despite the proliferation of spin_lock_irqsave calls in this stack, it is only entered from the IPv4/IPv6 stack and user space. That is, it is never entered from hardirq context. The call in question is only called from recvmsg which means that IRQs aren't disabled. Therefore it is safe to replace it with spin_lock_bh. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 2a3c0e08a090..e6926cb19420 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4368,15 +4368,11 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
4368 * However, this function was corrent in any case. 8) 4368 * However, this function was corrent in any case. 8)
4369 */ 4369 */
4370 if (flags & MSG_PEEK) { 4370 if (flags & MSG_PEEK) {
4371 unsigned long cpu_flags; 4371 spin_lock_bh(&sk->sk_receive_queue.lock);
4372
4373 sctp_spin_lock_irqsave(&sk->sk_receive_queue.lock,
4374 cpu_flags);
4375 skb = skb_peek(&sk->sk_receive_queue); 4372 skb = skb_peek(&sk->sk_receive_queue);
4376 if (skb) 4373 if (skb)
4377 atomic_inc(&skb->users); 4374 atomic_inc(&skb->users);
4378 sctp_spin_unlock_irqrestore(&sk->sk_receive_queue.lock, 4375 spin_unlock_bh(&sk->sk_receive_queue.lock);
4379 cpu_flags);
4380 } else { 4376 } else {
4381 skb = skb_dequeue(&sk->sk_receive_queue); 4377 skb = skb_dequeue(&sk->sk_receive_queue);
4382 } 4378 }