summaryrefslogtreecommitdiff
path: root/net/packet
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/packet
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/packet')
-rw-r--r--net/packet/af_packet.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 01f3515cada0..833e65252f1f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4554,20 +4554,6 @@ static const struct seq_operations packet_seq_ops = {
.stop = packet_seq_stop,
.show = packet_seq_show,
};
-
-static int packet_seq_open(struct inode *inode, struct file *file)
-{
- return seq_open_net(inode, file, &packet_seq_ops,
- sizeof(struct seq_net_private));
-}
-
-static const struct file_operations packet_seq_fops = {
- .open = packet_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release_net,
-};
-
#endif
static int __net_init packet_net_init(struct net *net)
@@ -4575,7 +4561,8 @@ static int __net_init packet_net_init(struct net *net)
mutex_init(&net->packet.sklist_lock);
INIT_HLIST_HEAD(&net->packet.sklist);
- if (!proc_create("packet", 0, net->proc_net, &packet_seq_fops))
+ if (!proc_create_net("packet", 0, net->proc_net, &packet_seq_ops,
+ sizeof(struct seq_net_private)))
return -ENOMEM;
return 0;