From 3617d9496cd92dcca4d0893191d95554590d8d9f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 13 Apr 2018 20:38:35 +0200 Subject: proc: introduce proc_create_net_single Variant of proc_create_data that directly take a seq_file show callback and deals with network namespaces in ->open and ->release. All callers of proc_create + single_open_net converted over, and single_{open,release}_net are removed entirely. Signed-off-by: Christoph Hellwig --- net/kcm/kcmproc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'net/kcm') diff --git a/net/kcm/kcmproc.c b/net/kcm/kcmproc.c index 6283ed2f43b2..370da2f80e3c 100644 --- a/net/kcm/kcmproc.c +++ b/net/kcm/kcmproc.c @@ -345,22 +345,10 @@ static int kcm_stats_seq_show(struct seq_file *seq, void *v) return 0; } -static int kcm_stats_seq_open(struct inode *inode, struct file *file) -{ - return single_open_net(inode, file, kcm_stats_seq_show); -} - -static const struct file_operations kcm_stats_seq_fops = { - .open = kcm_stats_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release_net, -}; - static int kcm_proc_init_net(struct net *net) { - if (!proc_create("kcm_stats", 0444, net->proc_net, - &kcm_stats_seq_fops)) + if (!proc_create_net_single("kcm_stats", 0444, net->proc_net, + kcm_stats_seq_show, NULL)) goto out_kcm_stats; if (!proc_create_net("kcm", 0444, net->proc_net, &kcm_seq_ops, -- cgit v1.2.3