summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udplite.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-10 21:31:50 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commita3d2599b24462c762719a70bc4d2ec8e8cb52fcf (patch)
treea3b5ae4182589c9ee914d4298366377112cb260b /net/ipv6/udplite.c
parent3f3942aca6da351a12543aa776467791b63b3a78 (diff)
downloadlinux-a3d2599b24462c762719a70bc4d2ec8e8cb52fcf.tar.gz
linux-a3d2599b24462c762719a70bc4d2ec8e8cb52fcf.tar.bz2
linux-a3d2599b24462c762719a70bc4d2ec8e8cb52fcf.zip
ipv{4,6}/udp{,lite}: simplify proc registration
Remove a couple indirections to make the code look like most other protocols. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'net/ipv6/udplite.c')
-rw-r--r--net/ipv6/udplite.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 14ae32bb1f3d..a119e57196b5 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -12,6 +12,7 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/export.h>
+#include <linux/proc_fs.h>
#include "udp_impl.h"
static int udplitev6_rcv(struct sk_buff *skb)
@@ -92,32 +93,22 @@ void udplitev6_exit(void)
}
#ifdef CONFIG_PROC_FS
-
-static const struct file_operations udplite6_afinfo_seq_fops = {
- .open = udp_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release_net
-};
-
static struct udp_seq_afinfo udplite6_seq_afinfo = {
- .name = "udplite6",
.family = AF_INET6,
.udp_table = &udplite_table,
- .seq_fops = &udplite6_afinfo_seq_fops,
- .seq_ops = {
- .show = udp6_seq_show,
- },
};
static int __net_init udplite6_proc_init_net(struct net *net)
{
- return udp_proc_register(net, &udplite6_seq_afinfo);
+ if (!proc_create_data("udplite6", 0444, net->proc_net,
+ &udp6_afinfo_seq_fops, &udplite6_seq_afinfo))
+ return -ENOMEM;
+ return 0;
}
static void __net_exit udplite6_proc_exit_net(struct net *net)
{
- udp_proc_unregister(net, &udplite6_seq_afinfo);
+ remove_proc_entry("udplite6", net->proc_net);
}
static struct pernet_operations udplite6_net_ops = {