aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-05-03 18:13:45 -0400
committerDavid S. Miller <davem@davemloft.net>2007-05-03 18:13:45 -0400
commit7562f876cd93800f2f8c89445f2a563590b24e09 (patch)
tree78a34c011af275efa0d55ba59c3bd49b771dd533 /net/ipv6/mcast.c
parent03fba0479600114f32d29eee74ca3eaa364606bf (diff)
[NET]: Rework dev_base via list_head (v3)
Cleanup of dev_base list use, with the aim to simplify making device list per-namespace. In almost every occasion, use of dev_base variable and dev->next pointer could be easily replaced by for_each_netdev loop. A few most complicated places were converted to using first_netdev()/next_netdev(). Signed-off-by: Pavel Emelianov <xemul@openvz.org> Acked-by: Kirill Korotaev <dev@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 6c2758951d60..3e308fb41b49 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2331,9 +2331,8 @@ static inline struct ifmcaddr6 *igmp6_mc_get_first(struct seq_file *seq)
2331 struct ifmcaddr6 *im = NULL; 2331 struct ifmcaddr6 *im = NULL;
2332 struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); 2332 struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
2333 2333
2334 for (state->dev = dev_base, state->idev = NULL; 2334 state->idev = NULL;
2335 state->dev; 2335 for_each_netdev(state->dev) {
2336 state->dev = state->dev->next) {
2337 struct inet6_dev *idev; 2336 struct inet6_dev *idev;
2338 idev = in6_dev_get(state->dev); 2337 idev = in6_dev_get(state->dev);
2339 if (!idev) 2338 if (!idev)
@@ -2360,7 +2359,7 @@ static struct ifmcaddr6 *igmp6_mc_get_next(struct seq_file *seq, struct ifmcaddr
2360 read_unlock_bh(&state->idev->lock); 2359 read_unlock_bh(&state->idev->lock);
2361 in6_dev_put(state->idev); 2360 in6_dev_put(state->idev);
2362 } 2361 }
2363 state->dev = state->dev->next; 2362 state->dev = next_net_device(state->dev);
2364 if (!state->dev) { 2363 if (!state->dev) {
2365 state->idev = NULL; 2364 state->idev = NULL;
2366 break; 2365 break;
@@ -2475,9 +2474,9 @@ static inline struct ip6_sf_list *igmp6_mcf_get_first(struct seq_file *seq)
2475 struct ifmcaddr6 *im = NULL; 2474 struct ifmcaddr6 *im = NULL;
2476 struct igmp6_mcf_iter_state *state = igmp6_mcf_seq_private(seq); 2475 struct igmp6_mcf_iter_state *state = igmp6_mcf_seq_private(seq);
2477 2476
2478 for (state->dev = dev_base, state->idev = NULL, state->im = NULL; 2477 state->idev = NULL;
2479 state->dev; 2478 state->im = NULL;
2480 state->dev = state->dev->next) { 2479 for_each_netdev(state->dev) {
2481 struct inet6_dev *idev; 2480 struct inet6_dev *idev;
2482 idev = in6_dev_get(state->dev); 2481 idev = in6_dev_get(state->dev);
2483 if (unlikely(idev == NULL)) 2482 if (unlikely(idev == NULL))
@@ -2513,7 +2512,7 @@ static struct ip6_sf_list *igmp6_mcf_get_next(struct seq_file *seq, struct ip6_s
2513 read_unlock_bh(&state->idev->lock); 2512 read_unlock_bh(&state->idev->lock);
2514 in6_dev_put(state->idev); 2513 in6_dev_put(state->idev);
2515 } 2514 }
2516 state->dev = state->dev->next; 2515 state->dev = next_net_device(state->dev);
2517 if (!state->dev) { 2516 if (!state->dev) {
2518 state->idev = NULL; 2517 state->idev = NULL;
2519 goto out; 2518 goto out;