aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
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 /net/ipv4/udp.c
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>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c15
1 files changed, 6 insertions, 9 deletions
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 },