Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171496
b: refs/heads/master
c: 61fbab7
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Nov 11, 2009
1 parent fb3aef0 commit 9954119
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa918602b61a71b4a9f47861b7e65c70258516c1
refs/heads/master: 61fbab77a843d2e772322ac130715cc9a98bf718
18 changes: 10 additions & 8 deletions trunk/net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ static inline struct ip_mc_list *igmp_mc_get_first(struct seq_file *seq)
struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);

state->in_dev = NULL;
for_each_netdev(net, state->dev) {
for_each_netdev_rcu(net, state->dev) {
struct in_device *in_dev;
in_dev = in_dev_get(state->dev);
if (!in_dev)
Expand Down Expand Up @@ -2361,9 +2361,9 @@ static struct ip_mc_list *igmp_mc_get_idx(struct seq_file *seq, loff_t pos)
}

static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(dev_base_lock)
__acquires(rcu)
{
read_lock(&dev_base_lock);
rcu_read_lock();
return *pos ? igmp_mc_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}

Expand All @@ -2379,7 +2379,7 @@ static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}

static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
__releases(dev_base_lock)
__releases(rcu)
{
struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
if (likely(state->in_dev != NULL)) {
Expand All @@ -2388,7 +2388,7 @@ static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
state->in_dev = NULL;
}
state->dev = NULL;
read_unlock(&dev_base_lock);
rcu_read_unlock();
}

static int igmp_mc_seq_show(struct seq_file *seq, void *v)
Expand Down Expand Up @@ -2462,7 +2462,7 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)

state->idev = NULL;
state->im = NULL;
for_each_netdev(net, state->dev) {
for_each_netdev_rcu(net, state->dev) {
struct in_device *idev;
idev = in_dev_get(state->dev);
if (unlikely(idev == NULL))
Expand Down Expand Up @@ -2528,8 +2528,9 @@ static struct ip_sf_list *igmp_mcf_get_idx(struct seq_file *seq, loff_t pos)
}

static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(rcu)
{
read_lock(&dev_base_lock);
rcu_read_lock();
return *pos ? igmp_mcf_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}

Expand All @@ -2545,6 +2546,7 @@ static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}

static void igmp_mcf_seq_stop(struct seq_file *seq, void *v)
__releases(rcu)
{
struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
if (likely(state->im != NULL)) {
Expand All @@ -2557,7 +2559,7 @@ static void igmp_mcf_seq_stop(struct seq_file *seq, void *v)
state->idev = NULL;
}
state->dev = NULL;
read_unlock(&dev_base_lock);
rcu_read_unlock();
}

static int igmp_mcf_seq_show(struct seq_file *seq, void *v)
Expand Down

0 comments on commit 9954119

Please sign in to comment.