aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-10 13:42:55 -0400
committerChristoph Hellwig <hch@lst.de>2018-05-16 01:24:30 -0400
commitc3506372277779fccbffee2475400fcd689d5738 (patch)
treed45d820f96a84a1223fa84c6ad4b7d84a81399aa /net/ipv6/tcp_ipv6.c
parenta2dcdee3748b664bf011b4b12de64e945dd4c8c2 (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.c17
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 = {
1916 .stop = tcp_seq_stop, 1916 .stop = tcp_seq_stop,
1917}; 1917};
1918 1918
1919static int tcp6_seq_open(struct inode *inode, struct file *file)
1920{
1921 return seq_open_net(inode, file, &tcp6_seq_ops,
1922 sizeof(struct tcp_iter_state));
1923}
1924
1925static const struct file_operations tcp6_afinfo_seq_fops = {
1926 .open = tcp6_seq_open,
1927 .read = seq_read,
1928 .llseek = seq_lseek,
1929 .release = seq_release_net
1930};
1931
1932static struct tcp_seq_afinfo tcp6_seq_afinfo = { 1919static struct tcp_seq_afinfo tcp6_seq_afinfo = {
1933 .family = AF_INET6, 1920 .family = AF_INET6,
1934}; 1921};
1935 1922
1936int __net_init tcp6_proc_init(struct net *net) 1923int __net_init tcp6_proc_init(struct net *net)
1937{ 1924{
1938 if (!proc_create_data("tcp6", 0444, net->proc_net, 1925 if (!proc_create_net_data("tcp6", 0444, net->proc_net, &tcp6_seq_ops,
1939 &tcp6_afinfo_seq_fops, &tcp6_seq_afinfo)) 1926 sizeof(struct tcp_iter_state), &tcp6_seq_afinfo))
1940 return -ENOMEM; 1927 return -ENOMEM;
1941 return 0; 1928 return 0;
1942} 1929}