summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-03-29 02:24:26 +0100
committerDavid S. Miller <davem@davemloft.net>2008-03-29 02:24:26 +0100
commitdda61925f84d89e2f2a4597d6298a05a2bc05c20 (patch)
tree8d66baedac68ed6a1c026f0142ab405f5c733597 /net/ipv4
parent[UDP]: No need to check afinfo != NULL in udp_proc_(un)register. (diff)
downloadlinux-dda61925f84d89e2f2a4597d6298a05a2bc05c20.tar.xz
linux-dda61925f84d89e2f2a4597d6298a05a2bc05c20.zip
[UDP]: Move seq_ops from udp_iter_state to udp_seq_afinfo.
No need to create seq_operations for each instance of 'netstat'. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/udp.c14
-rw-r--r--net/ipv4/udplite.c4
2 files changed, 11 insertions, 7 deletions
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)
s->family = afinfo->family;
s->hashtable = afinfo->hashtable;
- s->seq_ops.start = udp_seq_start;
- s->seq_ops.next = udp_seq_next;
- s->seq_ops.show = afinfo->seq_show;
- s->seq_ops.stop = udp_seq_stop;
s->p.net = net;
- rc = seq_open(file, &s->seq_ops);
+ rc = seq_open(file, &afinfo->seq_ops);
if (rc)
goto out_put_net;
@@ -1634,6 +1630,10 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
afinfo->seq_fops->llseek = seq_lseek;
afinfo->seq_fops->release = udp_seq_release;
+ afinfo->seq_ops.start = udp_seq_start;
+ afinfo->seq_ops.next = udp_seq_next;
+ afinfo->seq_ops.stop = udp_seq_stop;
+
p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops);
if (p)
p->data = afinfo;
@@ -1690,8 +1690,10 @@ static struct udp_seq_afinfo udp4_seq_afinfo = {
.name = "udp",
.family = AF_INET,
.hashtable = udp_hash,
- .seq_show = udp4_seq_show,
.seq_fops = &udp4_seq_fops,
+ .seq_ops = {
+ .show = udp4_seq_show,
+ },
};
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 = {
.name = "udplite",
.family = AF_INET,
.hashtable = udplite_hash,
- .seq_show = udp4_seq_show,
.seq_fops = &udplite4_seq_fops,
+ .seq_ops = {
+ .show = udp4_seq_show,
+ },
};
static int udplite4_proc_init_net(struct net *net)