net: procfs: use index hashlist instead of name hashlist
authorJiri Pirko <jiri@mellanox.com>
Mon, 30 Sep 2019 09:48:14 +0000 (11:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Oct 2019 21:47:19 +0000 (14:47 -0700)
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: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-procfs.c

index 3634793..6bbd06f 100644 (file)
@@ -20,8 +20,8 @@ static inline struct net_device *dev_from_same_bucket(struct seq_file *seq, loff
        struct hlist_head *h;
        unsigned int count = 0, offset = get_offset(*pos);
 
-       h = &net->dev_name_head[get_bucket(*pos)];
-       hlist_for_each_entry_rcu(dev, h, name_hlist) {
+       h = &net->dev_index_head[get_bucket(*pos)];
+       hlist_for_each_entry_rcu(dev, h, index_hlist) {
                if (++count == offset)
                        return dev;
        }