diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-10 20:42:55 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 08:24:30 +0300 |
commit | c3506372277779fccbffee2475400fcd689d5738 (patch) | |
tree | d45d820f96a84a1223fa84c6ad4b7d84a81399aa /net/ipv4/ping.c | |
parent | a2dcdee3748b664bf011b4b12de64e945dd4c8c2 (diff) | |
download | linux-c3506372277779fccbffee2475400fcd689d5738.tar.xz |
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/ipv4/ping.c')
-rw-r--r-- | net/ipv4/ping.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 4d21c24dba78..2ed64bca54e3 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -1157,22 +1157,10 @@ static const struct seq_operations ping_v4_seq_ops = { .stop = ping_seq_stop, }; -static int ping_v4_seq_open(struct inode *inode, struct file *file) -{ - return seq_open_net(inode, file, &ping_v4_seq_ops, - sizeof(struct ping_iter_state)); -} - -const struct file_operations ping_v4_seq_fops = { - .open = ping_v4_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_net, -}; - static int __net_init ping_v4_proc_init_net(struct net *net) { - if (!proc_create("icmp", 0444, net->proc_net, &ping_v4_seq_fops)) + if (!proc_create_net("icmp", 0444, net->proc_net, &ping_v4_seq_ops, + sizeof(struct ping_iter_state))) return -ENOMEM; return 0; } |