提交 6958c97a 编写于 作者: J Jiri Pirko 提交者: David S. Miller

net: procfs: use index hashlist instead of name hashlist

Name hashlist is going to be used for more than just dev->name, so use
rather index hashlist for iteration over net_device instances.
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 be2644aa
...@@ -20,8 +20,8 @@ static inline struct net_device *dev_from_same_bucket(struct seq_file *seq, loff ...@@ -20,8 +20,8 @@ static inline struct net_device *dev_from_same_bucket(struct seq_file *seq, loff
struct hlist_head *h; struct hlist_head *h;
unsigned int count = 0, offset = get_offset(*pos); unsigned int count = 0, offset = get_offset(*pos);
h = &net->dev_name_head[get_bucket(*pos)]; h = &net->dev_index_head[get_bucket(*pos)];
hlist_for_each_entry_rcu(dev, h, name_hlist) { hlist_for_each_entry_rcu(dev, h, index_hlist) {
if (++count == offset) if (++count == offset)
return dev; return dev;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册