diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-10 19:42:55 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 07:24:30 +0200 |
commit | c3506372277779fccbffee2475400fcd689d5738 (patch) | |
tree | d45d820f96a84a1223fa84c6ad4b7d84a81399aa /net/ipv6/tcp_ipv6.c | |
parent | a2dcdee3748b664bf011b4b12de64e945dd4c8c2 (diff) |
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 <hch@lst.de>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c0329bb1692f..d2ce66b23430 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1916,27 +1916,14 @@ static const struct seq_operations tcp6_seq_ops = { .stop = tcp_seq_stop, }; -static int tcp6_seq_open(struct inode *inode, struct file *file) -{ - return seq_open_net(inode, file, &tcp6_seq_ops, - sizeof(struct tcp_iter_state)); -} - -static const struct file_operations tcp6_afinfo_seq_fops = { - .open = tcp6_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_net -}; - static struct tcp_seq_afinfo tcp6_seq_afinfo = { .family = AF_INET6, }; int __net_init tcp6_proc_init(struct net *net) { - if (!proc_create_data("tcp6", 0444, net->proc_net, - &tcp6_afinfo_seq_fops, &tcp6_seq_afinfo)) + if (!proc_create_net_data("tcp6", 0444, net->proc_net, &tcp6_seq_ops, + sizeof(struct tcp_iter_state), &tcp6_seq_afinfo)) return -ENOMEM; return 0; } |