diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-10 19:34:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-10 19:37:26 -0500 |
commit | dbdd9a52e38a4a93adfa4d0278801cce4fad98eb (patch) | |
tree | a223ba84f33976b0d2c17d3177cbe976a3c948fc /net/ipv4/igmp.c | |
parent | 33175d84ee3fa29991adb80513683e010769e807 (diff) |
ipv4: Remove redundant RCU locking in ip_check_mc().
All callers are under rcu_read_lock() protection already.
Rename to ip_check_mc_rcu() to make it even more clear.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 44ba9068b72f..12b65ccca8e9 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -2333,13 +2333,13 @@ void ip_mc_drop_socket(struct sock *sk) | |||
2333 | rtnl_unlock(); | 2333 | rtnl_unlock(); |
2334 | } | 2334 | } |
2335 | 2335 | ||
2336 | int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto) | 2336 | /* called with rcu_read_lock() */ |
2337 | int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto) | ||
2337 | { | 2338 | { |
2338 | struct ip_mc_list *im; | 2339 | struct ip_mc_list *im; |
2339 | struct ip_sf_list *psf; | 2340 | struct ip_sf_list *psf; |
2340 | int rv = 0; | 2341 | int rv = 0; |
2341 | 2342 | ||
2342 | rcu_read_lock(); | ||
2343 | for_each_pmc_rcu(in_dev, im) { | 2343 | for_each_pmc_rcu(in_dev, im) { |
2344 | if (im->multiaddr == mc_addr) | 2344 | if (im->multiaddr == mc_addr) |
2345 | break; | 2345 | break; |
@@ -2361,7 +2361,6 @@ int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 p | |||
2361 | } else | 2361 | } else |
2362 | rv = 1; /* unspecified source; tentatively allow */ | 2362 | rv = 1; /* unspecified source; tentatively allow */ |
2363 | } | 2363 | } |
2364 | rcu_read_unlock(); | ||
2365 | return rv; | 2364 | return rv; |
2366 | } | 2365 | } |
2367 | 2366 | ||