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/packet/af_packet.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/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 17 |
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; |