aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlanproc.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2009-11-10 02:54:48 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-11 01:26:30 -0500
commit9e067597ee0e51a07bc158e9e2703ca676920e8b (patch)
tree07436378544524a78d834aa664819ce64f969e19 /net/8021q/vlanproc.c
parent254245d23396aca1f9100d500163d7bd6019ab6f (diff)
vlan: eliminate use of dev_base_lock
Do not need to use read_lock(&dev_base_lock), use RCU instead. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r--net/8021q/vlanproc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 6262c335f3c2..9ec1f057c03a 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -201,18 +201,17 @@ int vlan_proc_rem_dev(struct net_device *vlandev)
201 201
202/* start read of /proc/net/vlan/config */ 202/* start read of /proc/net/vlan/config */
203static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) 203static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
204 __acquires(dev_base_lock) 204 __acquires(rcu)
205{ 205{
206 struct net_device *dev; 206 struct net_device *dev;
207 struct net *net = seq_file_net(seq); 207 struct net *net = seq_file_net(seq);
208 loff_t i = 1; 208 loff_t i = 1;
209 209
210 read_lock(&dev_base_lock); 210 rcu_read_lock();
211
212 if (*pos == 0) 211 if (*pos == 0)
213 return SEQ_START_TOKEN; 212 return SEQ_START_TOKEN;
214 213
215 for_each_netdev(net, dev) { 214 for_each_netdev_rcu(net, dev) {
216 if (!is_vlan_dev(dev)) 215 if (!is_vlan_dev(dev))
217 continue; 216 continue;
218 217
@@ -234,7 +233,7 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
234 if (v == SEQ_START_TOKEN) 233 if (v == SEQ_START_TOKEN)
235 dev = net_device_entry(&net->dev_base_head); 234 dev = net_device_entry(&net->dev_base_head);
236 235
237 for_each_netdev_continue(net, dev) { 236 for_each_netdev_continue_rcu(net, dev) {
238 if (!is_vlan_dev(dev)) 237 if (!is_vlan_dev(dev))
239 continue; 238 continue;
240 239
@@ -245,9 +244,9 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
245} 244}
246 245
247static void vlan_seq_stop(struct seq_file *seq, void *v) 246static void vlan_seq_stop(struct seq_file *seq, void *v)
248 __releases(dev_base_lock) 247 __releases(rcu)
249{ 248{
250 read_unlock(&dev_base_lock); 249 rcu_read_unlock();
251} 250}
252 251
253static int vlan_seq_show(struct seq_file *seq, void *v) 252static int vlan_seq_show(struct seq_file *seq, void *v)