summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-10 19:42:55 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:24:30 +0200
commitc3506372277779fccbffee2475400fcd689d5738 (patch)
treed45d820f96a84a1223fa84c6ad4b7d84a81399aa /net/ipv6/udp.c
parenta2dcdee3748b664bf011b4b12de64e945dd4c8c2 (diff)
downloadlinux-c3506372277779fccbffee2475400fcd689d5738.tar.gz
linux-c3506372277779fccbffee2475400fcd689d5738.tar.bz2
linux-c3506372277779fccbffee2475400fcd689d5738.zip
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/udp.c')
-rw-r--r--net/ipv6/udp.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 29adddeac3e5..00e2112da26d 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1480,26 +1480,13 @@ int udp6_seq_show(struct seq_file *seq, void *v)
return 0;
}
-static const struct seq_operations udp6_seq_ops = {
+const struct seq_operations udp6_seq_ops = {
.start = udp_seq_start,
.next = udp_seq_next,
.stop = udp_seq_stop,
.show = udp6_seq_show,
};
-
-static int udp6_seq_open(struct inode *inode, struct file *file)
-{
- return seq_open_net(inode, file, &udp6_seq_ops,
- sizeof(struct udp_iter_state));
-}
-
-const struct file_operations udp6_afinfo_seq_fops = {
- .open = udp6_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release_net
-};
-EXPORT_SYMBOL(udp6_afinfo_seq_fops);
+EXPORT_SYMBOL(udp6_seq_ops);
static struct udp_seq_afinfo udp6_seq_afinfo = {
.family = AF_INET6,
@@ -1508,8 +1495,8 @@ static struct udp_seq_afinfo udp6_seq_afinfo = {
int __net_init udp6_proc_init(struct net *net)
{
- if (!proc_create_data("udp6", 0444, net->proc_net,
- &udp6_afinfo_seq_fops, &udp6_seq_afinfo))
+ if (!proc_create_net_data("udp6", 0444, net->proc_net, &udp6_seq_ops,
+ sizeof(struct udp_iter_state), &udp6_seq_afinfo))
return -ENOMEM;
return 0;
}