diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-10 22:31:50 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 08:23:35 +0300 |
commit | a3d2599b24462c762719a70bc4d2ec8e8cb52fcf (patch) | |
tree | a3b5ae4182589c9ee914d4298366377112cb260b /net/ipv4/udplite.c | |
parent | 3f3942aca6da351a12543aa776467791b63b3a78 (diff) | |
download | linux-a3d2599b24462c762719a70bc4d2ec8e8cb52fcf.tar.xz |
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/ipv4/udplite.c')
-rw-r--r-- | net/ipv4/udplite.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index f96614e9b9a5..4a6e67bfbe0d 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c @@ -14,6 +14,7 @@ #define pr_fmt(fmt) "UDPLite: " fmt #include <linux/export.h> +#include <linux/proc_fs.h> #include "udp_impl.h" struct udp_table udplite_table __read_mostly; @@ -73,32 +74,22 @@ static struct inet_protosw udplite4_protosw = { }; #ifdef CONFIG_PROC_FS - -static const struct file_operations udplite_afinfo_seq_fops = { - .open = udp_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_net -}; - static struct udp_seq_afinfo udplite4_seq_afinfo = { - .name = "udplite", .family = AF_INET, .udp_table = &udplite_table, - .seq_fops = &udplite_afinfo_seq_fops, - .seq_ops = { - .show = udp4_seq_show, - }, }; static int __net_init udplite4_proc_init_net(struct net *net) { - return udp_proc_register(net, &udplite4_seq_afinfo); + if (!proc_create_data("udplite", 0444, net->proc_net, + &udp_afinfo_seq_fops, &udplite4_seq_afinfo)) + return -ENOMEM; + return 0; } static void __net_exit udplite4_proc_exit_net(struct net *net) { - udp_proc_unregister(net, &udplite4_seq_afinfo); + remove_proc_entry("udplite", net->proc_net); } static struct pernet_operations udplite4_net_ops = { |