aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-14 01:13:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 01:13:30 -0400
commit68fcadd16c371d5e0698ba366f33a4f990ce83ce (patch)
tree074c58f40e77dd03f464e5d68f7f00841fa68f96
parent52d6f3f11bdb8c26fead701c9dbad08acd28063d (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>
-rw-r--r--include/net/tcp.h2
-rw-r--r--net/ipv4/tcp_ipv4.c15
-rw-r--r--net/ipv6/tcp_ipv6.c2
3 files changed, 7 insertions, 12 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2c9a650412c0..93479ebf3e33 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1328,7 +1328,7 @@ struct tcp_seq_afinfo {
1328 struct module *owner; 1328 struct module *owner;
1329 char *name; 1329 char *name;
1330 sa_family_t family; 1330 sa_family_t family;
1331 struct file_operations *seq_fops; 1331 struct file_operations seq_fops;
1332 struct seq_operations seq_ops; 1332 struct seq_operations seq_ops;
1333}; 1333};
1334 1334
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)
2253void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) 2253void 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
2259static void get_openreq4(struct sock *sk, struct request_sock *req, 2258static 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
2385static struct file_operations tcp4_seq_fops;
2386static struct tcp_seq_afinfo tcp4_seq_afinfo = { 2384static 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
2123static struct file_operations tcp6_seq_fops;
2124static struct tcp_seq_afinfo tcp6_seq_afinfo = { 2123static 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 },