From patchwork Tue Nov 10 17:54:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 59135 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAAJCjtO019068 for ; Tue, 10 Nov 2009 19:12:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757856AbZKJTMc (ORCPT ); Tue, 10 Nov 2009 14:12:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757867AbZKJTMc (ORCPT ); Tue, 10 Nov 2009 14:12:32 -0500 Received: from suva.vyatta.com ([76.74.103.44]:50641 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757856AbZKJTMb (ORCPT ); Tue, 10 Nov 2009 14:12:31 -0500 X-Greylist: delayed 3516 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Nov 2009 14:12:31 EST Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id nAAI7fCm000505; Tue, 10 Nov 2009 10:07:41 -0800 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id nAAI7Zq3000501; Tue, 10 Nov 2009 10:07:35 -0800 Message-Id: <20091110175647.480041042@vyatta.com> References: <20091110175446.280423729@vyatta.com> User-Agent: quilt/0.46-1 Date: Tue, 10 Nov 2009 09:54:51 -0800 From: Stephen Hemminger To: David Miller , Kyle McMartin , Helge Deller , Alexander Beregalov Cc: netdev@vger.kernel.org, linux-parisc@vger.kernel.org Subject: [PATCH 05/10] parisc: use RCU to find network device Content-Disposition: inline; filename=parisc-rdlock.patch Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org --- a/drivers/parisc/led.c 2009-11-09 22:19:07.223480872 -0800 +++ b/drivers/parisc/led.c 2009-11-10 09:28:38.279438787 -0800 @@ -354,9 +354,8 @@ static __inline__ int led_get_net_activi /* we are running as a workqueue task, so locking dev_base * for reading should be OK */ - read_lock(&dev_base_lock); rcu_read_lock(); - for_each_netdev(&init_net, dev) { + for_each_netdev_rcu(&init_net, dev) { const struct net_device_stats *stats; struct in_device *in_dev = __in_dev_get_rcu(dev); if (!in_dev || !in_dev->ifa_list) @@ -368,7 +367,6 @@ static __inline__ int led_get_net_activi tx_total += stats->tx_packets; } rcu_read_unlock(); - read_unlock(&dev_base_lock); retval = 0;