netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge use read_lock when scanning device list
@ 2004-01-12 21:46 Stephen Hemminger
  2004-01-14  0:19 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-01-12 21:46 UTC (permalink / raw)
  To: David S. Miller; +Cc: bridge, netdev

On 2.6.1, bridge is using rtnl_shlock which is equivalent to rtnl_lock when
all it really needs to do is read_lock(&dev_base_lock).


diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c
--- a/net/bridge/br_if.c	Mon Jan 12 13:45:44 2004
+++ b/net/bridge/br_if.c	Mon Jan 12 13:45:44 2004
@@ -252,12 +252,12 @@
 	struct net_device *dev;
 	int i = 0;
 
-	rtnl_shlock();
+	read_lock(&dev_base_lock);
 	for (dev = dev_base; dev && i < num; dev = dev->next) {
 		if (dev->priv_flags & IFF_EBRIDGE) 
 			indices[i++] = dev->ifindex;
 	}
-	rtnl_shunlock();
+	read_unlock(&dev_base_lock);
 
 	return i;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-14  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-12 21:46 [PATCH] bridge use read_lock when scanning device list Stephen Hemminger
2004-01-14  0:19 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).