diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-14 01:12:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-14 01:12:13 -0400 |
commit | 9427c4b36b8fe652df1d7c89eae678948e1f4b32 (patch) | |
tree | d2e018d9b09656e04e80ae3d3e88993e76753fbb /net/ipv4/tcp_ipv4.c | |
parent | 1abf4fb20d38cf58c92b27f4d6ad4fa92a3bb553 (diff) |
[TCP]: Move seq_ops from tcp_iter_state to tcp_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/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 978d9db1df34..c50dd1793643 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2229,13 +2229,9 @@ static int tcp_seq_open(struct inode *inode, struct file *file) | |||
2229 | goto out_kfree; | 2229 | goto out_kfree; |
2230 | 2230 | ||
2231 | s->family = afinfo->family; | 2231 | s->family = afinfo->family; |
2232 | s->seq_ops.start = tcp_seq_start; | ||
2233 | s->seq_ops.next = tcp_seq_next; | ||
2234 | s->seq_ops.show = afinfo->seq_show; | ||
2235 | s->seq_ops.stop = tcp_seq_stop; | ||
2236 | s->p.net = net; | 2232 | s->p.net = net; |
2237 | 2233 | ||
2238 | rc = seq_open(file, &s->seq_ops); | 2234 | rc = seq_open(file, &afinfo->seq_ops); |
2239 | if (rc) | 2235 | if (rc) |
2240 | goto out_put_net; | 2236 | goto out_put_net; |
2241 | seq = file->private_data; | 2237 | seq = file->private_data; |
@@ -2269,6 +2265,10 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) | |||
2269 | afinfo->seq_fops->llseek = seq_lseek; | 2265 | afinfo->seq_fops->llseek = seq_lseek; |
2270 | afinfo->seq_fops->release = tcp_seq_release; | 2266 | afinfo->seq_fops->release = tcp_seq_release; |
2271 | 2267 | ||
2268 | afinfo->seq_ops.start = tcp_seq_start; | ||
2269 | afinfo->seq_ops.next = tcp_seq_next; | ||
2270 | afinfo->seq_ops.stop = tcp_seq_stop; | ||
2271 | |||
2272 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); | 2272 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); |
2273 | if (p) | 2273 | if (p) |
2274 | p->data = afinfo; | 2274 | p->data = afinfo; |
@@ -2414,8 +2414,10 @@ static struct tcp_seq_afinfo tcp4_seq_afinfo = { | |||
2414 | .owner = THIS_MODULE, | 2414 | .owner = THIS_MODULE, |
2415 | .name = "tcp", | 2415 | .name = "tcp", |
2416 | .family = AF_INET, | 2416 | .family = AF_INET, |
2417 | .seq_show = tcp4_seq_show, | ||
2418 | .seq_fops = &tcp4_seq_fops, | 2417 | .seq_fops = &tcp4_seq_fops, |
2418 | .seq_ops = { | ||
2419 | .show = tcp4_seq_show, | ||
2420 | }, | ||
2419 | }; | 2421 | }; |
2420 | 2422 | ||
2421 | static int tcp4_proc_init_net(struct net *net) | 2423 | static int tcp4_proc_init_net(struct net *net) |