o net/core/dev: add missing ++*pos in dev_seq_next

This cures the problem reported in lkml when there are lots
of net devices, tested with 50 dummy interfaces, there is
still one glitch when there are more info produced than
one page, where one entry is missed, I'm working on this
one now.

Ah, dev_seq_show needs only seq_puts, not the more expensive
seq_printf.
parent 594cae2c
...@@ -1802,6 +1802,7 @@ void *dev_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -1802,6 +1802,7 @@ void *dev_seq_start(struct seq_file *seq, loff_t *pos)
void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ {
++*pos;
return v == (void *)1 ? dev_base : ((struct net_device *)v)->next; return v == (void *)1 ? dev_base : ((struct net_device *)v)->next;
} }
...@@ -1843,7 +1844,7 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev) ...@@ -1843,7 +1844,7 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
static int dev_seq_show(struct seq_file *seq, void *v) static int dev_seq_show(struct seq_file *seq, void *v)
{ {
if (v == (void *)1) if (v == (void *)1)
seq_printf(seq, "Inter-| Receive " seq_puts(seq, "Inter-| Receive "
" | Transmit\n" " | Transmit\n"
" face |bytes packets errs drop fifo frame " " face |bytes packets errs drop fifo frame "
"compressed multicast|bytes packets errs " "compressed multicast|bytes packets errs "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment