From c3506372277779fccbffee2475400fcd689d5738 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 10 Apr 2018 19:42:55 +0200 Subject: proc: introduce proc_create_net{,_data} Variants of proc_create{,_data} that directly take a struct seq_operations and deal with network namespaces in ->open and ->release. All callers of proc_create + seq_open_net converted over, and seq_{open,release}_net are removed entirely. Signed-off-by: Christoph Hellwig --- net/ipv6/route.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'net/ipv6/route.c') diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f4d61736c41a..527b9b644f5a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -4862,14 +4862,6 @@ static int ip6_route_dev_notify(struct notifier_block *this, */ #ifdef CONFIG_PROC_FS - -static const struct file_operations ipv6_route_proc_fops = { - .open = ipv6_route_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_net, -}; - static int rt6_stats_seq_show(struct seq_file *seq, void *v) { struct net *net = (struct net *)seq->private; @@ -5100,7 +5092,8 @@ static void __net_exit ip6_route_net_exit(struct net *net) static int __net_init ip6_route_net_init_late(struct net *net) { #ifdef CONFIG_PROC_FS - proc_create("ipv6_route", 0, net->proc_net, &ipv6_route_proc_fops); + proc_create_net("ipv6_route", 0, net->proc_net, &ipv6_route_seq_ops, + sizeof(struct ipv6_route_iter)); proc_create("rt6_stats", 0444, net->proc_net, &rt6_stats_seq_fops); #endif return 0; -- cgit v1.2.3