diff options
-rw-r--r-- | include/net/udp.h | 3 | ||||
-rw-r--r-- | net/ipv4/udp.c | 14 | ||||
-rw-r--r-- | net/ipv4/udplite.c | 4 | ||||
-rw-r--r-- | net/ipv6/udp.c | 4 | ||||
-rw-r--r-- | net/ipv6/udplite.c | 4 |
5 files changed, 18 insertions, 11 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 77af7d46d868..0079d17fd3a3 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -189,8 +189,8 @@ struct udp_seq_afinfo { | |||
189 | char *name; | 189 | char *name; |
190 | sa_family_t family; | 190 | sa_family_t family; |
191 | struct hlist_head *hashtable; | 191 | struct hlist_head *hashtable; |
192 | int (*seq_show) (struct seq_file *m, void *v); | ||
193 | struct file_operations *seq_fops; | 192 | struct file_operations *seq_fops; |
193 | struct seq_operations seq_ops; | ||
194 | }; | 194 | }; |
195 | 195 | ||
196 | struct udp_iter_state { | 196 | struct udp_iter_state { |
@@ -198,7 +198,6 @@ struct udp_iter_state { | |||
198 | sa_family_t family; | 198 | sa_family_t family; |
199 | struct hlist_head *hashtable; | 199 | struct hlist_head *hashtable; |
200 | int bucket; | 200 | int bucket; |
201 | struct seq_operations seq_ops; | ||
202 | }; | 201 | }; |
203 | 202 | ||
204 | #ifdef CONFIG_PROC_FS | 203 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index eb0c64da2634..bae94b3eaa43 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1591,13 +1591,9 @@ static int udp_seq_open(struct inode *inode, struct file *file) | |||
1591 | 1591 | ||
1592 | s->family = afinfo->family; | 1592 | s->family = afinfo->family; |
1593 | s->hashtable = afinfo->hashtable; | 1593 | s->hashtable = afinfo->hashtable; |
1594 | s->seq_ops.start = udp_seq_start; | ||
1595 | s->seq_ops.next = udp_seq_next; | ||
1596 | s->seq_ops.show = afinfo->seq_show; | ||
1597 | s->seq_ops.stop = udp_seq_stop; | ||
1598 | s->p.net = net; | 1594 | s->p.net = net; |
1599 | 1595 | ||
1600 | rc = seq_open(file, &s->seq_ops); | 1596 | rc = seq_open(file, &afinfo->seq_ops); |
1601 | if (rc) | 1597 | if (rc) |
1602 | goto out_put_net; | 1598 | goto out_put_net; |
1603 | 1599 | ||
@@ -1634,6 +1630,10 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo) | |||
1634 | afinfo->seq_fops->llseek = seq_lseek; | 1630 | afinfo->seq_fops->llseek = seq_lseek; |
1635 | afinfo->seq_fops->release = udp_seq_release; | 1631 | afinfo->seq_fops->release = udp_seq_release; |
1636 | 1632 | ||
1633 | afinfo->seq_ops.start = udp_seq_start; | ||
1634 | afinfo->seq_ops.next = udp_seq_next; | ||
1635 | afinfo->seq_ops.stop = udp_seq_stop; | ||
1636 | |||
1637 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); | 1637 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); |
1638 | if (p) | 1638 | if (p) |
1639 | p->data = afinfo; | 1639 | p->data = afinfo; |
@@ -1690,8 +1690,10 @@ static struct udp_seq_afinfo udp4_seq_afinfo = { | |||
1690 | .name = "udp", | 1690 | .name = "udp", |
1691 | .family = AF_INET, | 1691 | .family = AF_INET, |
1692 | .hashtable = udp_hash, | 1692 | .hashtable = udp_hash, |
1693 | .seq_show = udp4_seq_show, | ||
1694 | .seq_fops = &udp4_seq_fops, | 1693 | .seq_fops = &udp4_seq_fops, |
1694 | .seq_ops = { | ||
1695 | .show = udp4_seq_show, | ||
1696 | }, | ||
1695 | }; | 1697 | }; |
1696 | 1698 | ||
1697 | static int udp4_proc_init_net(struct net *net) | 1699 | static int udp4_proc_init_net(struct net *net) |
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index 7c1e0271c0db..4add87553bce 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -77,8 +77,10 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = { | |||
77 | .name = "udplite", | 77 | .name = "udplite", |
78 | .family = AF_INET, | 78 | .family = AF_INET, |
79 | .hashtable = udplite_hash, | 79 | .hashtable = udplite_hash, |
80 | .seq_show = udp4_seq_show, | ||
81 | .seq_fops = &udplite4_seq_fops, | 80 | .seq_fops = &udplite4_seq_fops, |
81 | .seq_ops = { | ||
82 | .show = udp4_seq_show, | ||
83 | }, | ||
82 | }; | 84 | }; |
83 | 85 | ||
84 | static int udplite4_proc_init_net(struct net *net) | 86 | static int udplite4_proc_init_net(struct net *net) |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 463ae4d448a3..e35921a46689 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -983,8 +983,10 @@ static struct udp_seq_afinfo udp6_seq_afinfo = { | |||
983 | .name = "udp6", | 983 | .name = "udp6", |
984 | .family = AF_INET6, | 984 | .family = AF_INET6, |
985 | .hashtable = udp_hash, | 985 | .hashtable = udp_hash, |
986 | .seq_show = udp6_seq_show, | ||
987 | .seq_fops = &udp6_seq_fops, | 986 | .seq_fops = &udp6_seq_fops, |
987 | .seq_ops = { | ||
988 | .show = udp6_seq_show, | ||
989 | }, | ||
988 | }; | 990 | }; |
989 | 991 | ||
990 | int udp6_proc_init(struct net *net) | 992 | int udp6_proc_init(struct net *net) |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index c5f5357d115d..710366c3f0a6 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -102,8 +102,10 @@ static struct udp_seq_afinfo udplite6_seq_afinfo = { | |||
102 | .name = "udplite6", | 102 | .name = "udplite6", |
103 | .family = AF_INET6, | 103 | .family = AF_INET6, |
104 | .hashtable = udplite_hash, | 104 | .hashtable = udplite_hash, |
105 | .seq_show = udp6_seq_show, | ||
106 | .seq_fops = &udplite6_seq_fops, | 105 | .seq_fops = &udplite6_seq_fops, |
106 | .seq_ops = { | ||
107 | .show = udp6_seq_show, | ||
108 | }, | ||
107 | }; | 109 | }; |
108 | 110 | ||
109 | static int udplite6_proc_init_net(struct net *net) | 111 | static int udplite6_proc_init_net(struct net *net) |