netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: bridge@osdl.org, netdev@oss.sgi.com
Subject: [PATCH] bridge use read_lock when scanning device list
Date: Mon, 12 Jan 2004 13:46:45 -0800	[thread overview]
Message-ID: <20040112134645.461f125e.shemminger@osdl.org> (raw)

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;
 }

             reply	other threads:[~2004-01-12 21:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-12 21:46 Stephen Hemminger [this message]
2004-01-14  0:19 ` [PATCH] bridge use read_lock when scanning device list David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040112134645.461f125e.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=bridge@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).