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/unix/af_unix.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'net/unix') diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 68bb70a62afe..e5473c03d667 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2852,20 +2852,6 @@ static const struct seq_operations unix_seq_ops = { .stop = unix_seq_stop, .show = unix_seq_show, }; - -static int unix_seq_open(struct inode *inode, struct file *file) -{ - return seq_open_net(inode, file, &unix_seq_ops, - sizeof(struct seq_net_private)); -} - -static const struct file_operations unix_seq_fops = { - .open = unix_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_net, -}; - #endif static const struct net_proto_family unix_family_ops = { @@ -2884,7 +2870,8 @@ static int __net_init unix_net_init(struct net *net) goto out; #ifdef CONFIG_PROC_FS - if (!proc_create("unix", 0, net->proc_net, &unix_seq_fops)) { + if (!proc_create_net("unix", 0, net->proc_net, &unix_seq_ops, + sizeof(struct seq_net_private))) { unix_sysctl_unregister(net); goto out; } -- cgit v1.2.3