aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ce6cb34e28e1..9e491e70e855 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2279,9 +2279,10 @@ static const struct file_operations fib_triestat_fops = {
2279 .release = fib_triestat_seq_release, 2279 .release = fib_triestat_seq_release,
2280}; 2280};
2281 2281
2282static struct node *fib_trie_get_idx(struct fib_trie_iter *iter, loff_t pos) 2282static struct node *fib_trie_get_idx(struct seq_file *seq, loff_t pos)
2283{ 2283{
2284 struct net *net = iter->p.net; 2284 struct fib_trie_iter *iter = seq->private;
2285 struct net *net = seq_file_net(seq);
2285 loff_t idx = 0; 2286 loff_t idx = 0;
2286 unsigned int h; 2287 unsigned int h;
2287 2288
@@ -2309,16 +2310,14 @@ static struct node *fib_trie_get_idx(struct fib_trie_iter *iter, loff_t pos)
2309static void *fib_trie_seq_start(struct seq_file *seq, loff_t *pos) 2310static void *fib_trie_seq_start(struct seq_file *seq, loff_t *pos)
2310 __acquires(RCU) 2311 __acquires(RCU)
2311{ 2312{
2312 struct fib_trie_iter *iter = seq->private;
2313
2314 rcu_read_lock(); 2313 rcu_read_lock();
2315 return fib_trie_get_idx(iter, *pos); 2314 return fib_trie_get_idx(seq, *pos);
2316} 2315}
2317 2316
2318static void *fib_trie_seq_next(struct seq_file *seq, void *v, loff_t *pos) 2317static void *fib_trie_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2319{ 2318{
2320 struct fib_trie_iter *iter = seq->private; 2319 struct fib_trie_iter *iter = seq->private;
2321 struct net *net = iter->p.net; 2320 struct net *net = seq_file_net(seq);
2322 struct fib_table *tb = iter->tb; 2321 struct fib_table *tb = iter->tb;
2323 struct hlist_node *tb_node; 2322 struct hlist_node *tb_node;
2324 unsigned int h; 2323 unsigned int h;
@@ -2513,7 +2512,7 @@ static void *fib_route_seq_start(struct seq_file *seq, loff_t *pos)
2513 struct fib_table *tb; 2512 struct fib_table *tb;
2514 2513
2515 rcu_read_lock(); 2514 rcu_read_lock();
2516 tb = fib_get_table(iter->p.net, RT_TABLE_MAIN); 2515 tb = fib_get_table(seq_file_net(seq), RT_TABLE_MAIN);
2517 if (!tb) 2516 if (!tb)
2518 return NULL; 2517 return NULL;
2519 2518