From patchwork Fri May 8 16:30:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Whitehouse X-Patchwork-Id: 27017 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 73DECB7067 for ; Sat, 9 May 2009 02:31:11 +1000 (EST) Received: by ozlabs.org (Postfix) id 5CD9BDDE07; Sat, 9 May 2009 02:31:11 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id ECE4ADDDF0 for ; Sat, 9 May 2009 02:31:10 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755074AbZEHQa4 (ORCPT ); Fri, 8 May 2009 12:30:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753871AbZEHQa4 (ORCPT ); Fri, 8 May 2009 12:30:56 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46201 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbZEHQaz (ORCPT ); Fri, 8 May 2009 12:30:55 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n48GUv3C022649 for ; Fri, 8 May 2009 12:30:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n48GUu5Q016721; Fri, 8 May 2009 12:30:56 -0400 Received: from [172.31.0.2] (vpn-12-2.rdu.redhat.com [10.11.12.2]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n48GUs7i005373; Fri, 8 May 2009 12:30:55 -0400 Subject: decnet: Use data ready call back, rather than hand coding it From: Steven Whitehouse To: ccaulfie@redhat.com Cc: netdev@vger.kernel.org Organization: Red Hat (UK) Ltd (Registered in England and Wales, No. 3798903) Registered office: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 ITE Date: Fri, 08 May 2009 17:30:25 +0100 Message-Id: <1241800225.29604.282.camel@localhost.localdomain> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Chrissie, can you test this? I don't have a suitable set up at the moment. This should be correct though since its taken directly from sock_queue_rcv_skb from whence the original code was also take in times past. I did compile test it though. Signed-off-by: Steven Whitehouse --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 5d8a2a5..932408d 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c @@ -578,6 +578,7 @@ out: static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_head *queue) { int err; + int skb_len; /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces number of warnings when compiling with -W --ANK @@ -592,22 +593,12 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig if (err) goto out; + skb_len = skb->len; skb_set_owner_r(skb, sk); skb_queue_tail(queue, skb); - /* This code only runs from BH or BH protected context. - * Therefore the plain read_lock is ok here. -DaveM - */ - read_lock(&sk->sk_callback_lock); - if (!sock_flag(sk, SOCK_DEAD)) { - struct socket *sock = sk->sk_socket; - wake_up_interruptible(sk->sk_sleep); - if (sock && sock->fasync_list && - !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) - __kill_fasync(sock->fasync_list, sig, - (sig == SIGURG) ? POLL_PRI : POLL_IN); - } - read_unlock(&sk->sk_callback_lock); + if (!sock_flag(sk, SOCK_DEAD)) + sk->sk_data_ready(sk, skb_len); out: return err; }