diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-14 01:13:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-14 01:13:30 -0400 |
commit | 68fcadd16c371d5e0698ba366f33a4f990ce83ce (patch) | |
tree | 074c58f40e77dd03f464e5d68f7f00841fa68f96 /net | |
parent | 52d6f3f11bdb8c26fead701c9dbad08acd28063d (diff) |
[TCP]: Place file operations directly into tcp_seq_afinfo.
No need to have separate never-used variable.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 15 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 |
2 files changed, 6 insertions, 11 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 840346b390d7..3696c83aec19 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2232,17 +2232,17 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) | |||
2232 | int rc = 0; | 2232 | int rc = 0; |
2233 | struct proc_dir_entry *p; | 2233 | struct proc_dir_entry *p; |
2234 | 2234 | ||
2235 | afinfo->seq_fops->owner = afinfo->owner; | 2235 | afinfo->seq_fops.owner = afinfo->owner; |
2236 | afinfo->seq_fops->open = tcp_seq_open; | 2236 | afinfo->seq_fops.open = tcp_seq_open; |
2237 | afinfo->seq_fops->read = seq_read; | 2237 | afinfo->seq_fops.read = seq_read; |
2238 | afinfo->seq_fops->llseek = seq_lseek; | 2238 | afinfo->seq_fops.llseek = seq_lseek; |
2239 | afinfo->seq_fops->release = seq_release_net; | 2239 | afinfo->seq_fops.release = seq_release_net; |
2240 | 2240 | ||
2241 | afinfo->seq_ops.start = tcp_seq_start; | 2241 | afinfo->seq_ops.start = tcp_seq_start; |
2242 | afinfo->seq_ops.next = tcp_seq_next; | 2242 | afinfo->seq_ops.next = tcp_seq_next; |
2243 | afinfo->seq_ops.stop = tcp_seq_stop; | 2243 | afinfo->seq_ops.stop = tcp_seq_stop; |
2244 | 2244 | ||
2245 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); | 2245 | p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); |
2246 | if (p) | 2246 | if (p) |
2247 | p->data = afinfo; | 2247 | p->data = afinfo; |
2248 | else | 2248 | else |
@@ -2253,7 +2253,6 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) | |||
2253 | void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) | 2253 | void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) |
2254 | { | 2254 | { |
2255 | proc_net_remove(net, afinfo->name); | 2255 | proc_net_remove(net, afinfo->name); |
2256 | memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); | ||
2257 | } | 2256 | } |
2258 | 2257 | ||
2259 | static void get_openreq4(struct sock *sk, struct request_sock *req, | 2258 | static void get_openreq4(struct sock *sk, struct request_sock *req, |
@@ -2382,12 +2381,10 @@ out: | |||
2382 | return 0; | 2381 | return 0; |
2383 | } | 2382 | } |
2384 | 2383 | ||
2385 | static struct file_operations tcp4_seq_fops; | ||
2386 | static struct tcp_seq_afinfo tcp4_seq_afinfo = { | 2384 | static struct tcp_seq_afinfo tcp4_seq_afinfo = { |
2387 | .owner = THIS_MODULE, | 2385 | .owner = THIS_MODULE, |
2388 | .name = "tcp", | 2386 | .name = "tcp", |
2389 | .family = AF_INET, | 2387 | .family = AF_INET, |
2390 | .seq_fops = &tcp4_seq_fops, | ||
2391 | .seq_ops = { | 2388 | .seq_ops = { |
2392 | .show = tcp4_seq_show, | 2389 | .show = tcp4_seq_show, |
2393 | }, | 2390 | }, |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 8bf59ee51cdb..e33a3dc7a000 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -2120,12 +2120,10 @@ out: | |||
2120 | return 0; | 2120 | return 0; |
2121 | } | 2121 | } |
2122 | 2122 | ||
2123 | static struct file_operations tcp6_seq_fops; | ||
2124 | static struct tcp_seq_afinfo tcp6_seq_afinfo = { | 2123 | static struct tcp_seq_afinfo tcp6_seq_afinfo = { |
2125 | .owner = THIS_MODULE, | 2124 | .owner = THIS_MODULE, |
2126 | .name = "tcp6", | 2125 | .name = "tcp6", |
2127 | .family = AF_INET6, | 2126 | .family = AF_INET6, |
2128 | .seq_fops = &tcp6_seq_fops, | ||
2129 | .seq_ops = { | 2127 | .seq_ops = { |
2130 | .show = tcp6_seq_show, | 2128 | .show = tcp6_seq_show, |
2131 | }, | 2129 | }, |