提交 9e067597 编写于 作者: S stephen hemminger 提交者: David S. Miller

vlan: eliminate use of dev_base_lock

Do not need to use read_lock(&dev_base_lock), use RCU instead.
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 254245d2
...@@ -201,18 +201,17 @@ int vlan_proc_rem_dev(struct net_device *vlandev) ...@@ -201,18 +201,17 @@ int vlan_proc_rem_dev(struct net_device *vlandev)
/* start read of /proc/net/vlan/config */ /* start read of /proc/net/vlan/config */
static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(dev_base_lock) __acquires(rcu)
{ {
struct net_device *dev; struct net_device *dev;
struct net *net = seq_file_net(seq); struct net *net = seq_file_net(seq);
loff_t i = 1; loff_t i = 1;
read_lock(&dev_base_lock); rcu_read_lock();
if (*pos == 0) if (*pos == 0)
return SEQ_START_TOKEN; return SEQ_START_TOKEN;
for_each_netdev(net, dev) { for_each_netdev_rcu(net, dev) {
if (!is_vlan_dev(dev)) if (!is_vlan_dev(dev))
continue; continue;
...@@ -234,7 +233,7 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -234,7 +233,7 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
dev = net_device_entry(&net->dev_base_head); dev = net_device_entry(&net->dev_base_head);
for_each_netdev_continue(net, dev) { for_each_netdev_continue_rcu(net, dev) {
if (!is_vlan_dev(dev)) if (!is_vlan_dev(dev))
continue; continue;
...@@ -245,9 +244,9 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -245,9 +244,9 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
} }
static void vlan_seq_stop(struct seq_file *seq, void *v) static void vlan_seq_stop(struct seq_file *seq, void *v)
__releases(dev_base_lock) __releases(rcu)
{ {
read_unlock(&dev_base_lock); rcu_read_unlock();
} }
static int vlan_seq_show(struct seq_file *seq, void *v) static int vlan_seq_show(struct seq_file *seq, void *v)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册