aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-03-28 21:25:32 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-28 21:25:32 -0400
commit3ba9441bdf07370670a684e6d95dfc523476677f (patch)
treeec31a5f5c5e1fc0d807575c733a04d2adbf44c09
parenta2be75c182cd16bc104919e33451ffda8b6f65b4 (diff)
[UDP]: Place file operations directly into udp_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/udp.h2
-rw-r--r--net/ipv4/udp.c15
-rw-r--r--net/ipv4/udplite.c2
-rw-r--r--net/ipv6/udp.c2
-rw-r--r--net/ipv6/udplite.c2
5 files changed, 7 insertions, 16 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 0079d17fd3a3..5cf0e593dda7 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -189,7 +189,7 @@ 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 struct file_operations *seq_fops; 192 struct file_operations seq_fops;
193 struct seq_operations seq_ops; 193 struct seq_operations seq_ops;
194}; 194};
195 195
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e716d2d55e1e..a95dff8063a4 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1596,17 +1596,17 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
1596 struct proc_dir_entry *p; 1596 struct proc_dir_entry *p;
1597 int rc = 0; 1597 int rc = 0;
1598 1598
1599 afinfo->seq_fops->owner = afinfo->owner; 1599 afinfo->seq_fops.owner = afinfo->owner;
1600 afinfo->seq_fops->open = udp_seq_open; 1600 afinfo->seq_fops.open = udp_seq_open;
1601 afinfo->seq_fops->read = seq_read; 1601 afinfo->seq_fops.read = seq_read;
1602 afinfo->seq_fops->llseek = seq_lseek; 1602 afinfo->seq_fops.llseek = seq_lseek;
1603 afinfo->seq_fops->release = seq_release_net; 1603 afinfo->seq_fops.release = seq_release_net;
1604 1604
1605 afinfo->seq_ops.start = udp_seq_start; 1605 afinfo->seq_ops.start = udp_seq_start;
1606 afinfo->seq_ops.next = udp_seq_next; 1606 afinfo->seq_ops.next = udp_seq_next;
1607 afinfo->seq_ops.stop = udp_seq_stop; 1607 afinfo->seq_ops.stop = udp_seq_stop;
1608 1608
1609 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); 1609 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops);
1610 if (p) 1610 if (p)
1611 p->data = afinfo; 1611 p->data = afinfo;
1612 else 1612 else
@@ -1617,7 +1617,6 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
1617void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo) 1617void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo)
1618{ 1618{
1619 proc_net_remove(net, afinfo->name); 1619 proc_net_remove(net, afinfo->name);
1620 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
1621} 1620}
1622 1621
1623/* ------------------------------------------------------------------------ */ 1622/* ------------------------------------------------------------------------ */
@@ -1656,13 +1655,11 @@ int udp4_seq_show(struct seq_file *seq, void *v)
1656} 1655}
1657 1656
1658/* ------------------------------------------------------------------------ */ 1657/* ------------------------------------------------------------------------ */
1659static struct file_operations udp4_seq_fops;
1660static struct udp_seq_afinfo udp4_seq_afinfo = { 1658static struct udp_seq_afinfo udp4_seq_afinfo = {
1661 .owner = THIS_MODULE, 1659 .owner = THIS_MODULE,
1662 .name = "udp", 1660 .name = "udp",
1663 .family = AF_INET, 1661 .family = AF_INET,
1664 .hashtable = udp_hash, 1662 .hashtable = udp_hash,
1665 .seq_fops = &udp4_seq_fops,
1666 .seq_ops = { 1663 .seq_ops = {
1667 .show = udp4_seq_show, 1664 .show = udp4_seq_show,
1668 }, 1665 },
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 4add87553bce..148ae72af111 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -71,13 +71,11 @@ static struct inet_protosw udplite4_protosw = {
71}; 71};
72 72
73#ifdef CONFIG_PROC_FS 73#ifdef CONFIG_PROC_FS
74static struct file_operations udplite4_seq_fops;
75static struct udp_seq_afinfo udplite4_seq_afinfo = { 74static struct udp_seq_afinfo udplite4_seq_afinfo = {
76 .owner = THIS_MODULE, 75 .owner = THIS_MODULE,
77 .name = "udplite", 76 .name = "udplite",
78 .family = AF_INET, 77 .family = AF_INET,
79 .hashtable = udplite_hash, 78 .hashtable = udplite_hash,
80 .seq_fops = &udplite4_seq_fops,
81 .seq_ops = { 79 .seq_ops = {
82 .show = udp4_seq_show, 80 .show = udp4_seq_show,
83 }, 81 },
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e35921a46689..ff8d53ecdd60 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -977,13 +977,11 @@ int udp6_seq_show(struct seq_file *seq, void *v)
977 return 0; 977 return 0;
978} 978}
979 979
980static struct file_operations udp6_seq_fops;
981static struct udp_seq_afinfo udp6_seq_afinfo = { 980static struct udp_seq_afinfo udp6_seq_afinfo = {
982 .owner = THIS_MODULE, 981 .owner = THIS_MODULE,
983 .name = "udp6", 982 .name = "udp6",
984 .family = AF_INET6, 983 .family = AF_INET6,
985 .hashtable = udp_hash, 984 .hashtable = udp_hash,
986 .seq_fops = &udp6_seq_fops,
987 .seq_ops = { 985 .seq_ops = {
988 .show = udp6_seq_show, 986 .show = udp6_seq_show,
989 }, 987 },
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 710366c3f0a6..5adf651d0721 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -96,13 +96,11 @@ void udplitev6_exit(void)
96} 96}
97 97
98#ifdef CONFIG_PROC_FS 98#ifdef CONFIG_PROC_FS
99static struct file_operations udplite6_seq_fops;
100static struct udp_seq_afinfo udplite6_seq_afinfo = { 99static struct udp_seq_afinfo udplite6_seq_afinfo = {
101 .owner = THIS_MODULE, 100 .owner = THIS_MODULE,
102 .name = "udplite6", 101 .name = "udplite6",
103 .family = AF_INET6, 102 .family = AF_INET6,
104 .hashtable = udplite_hash, 103 .hashtable = udplite_hash,
105 .seq_fops = &udplite6_seq_fops,
106 .seq_ops = { 104 .seq_ops = {
107 .show = udp6_seq_show, 105 .show = udp6_seq_show,
108 }, 106 },