aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-11-20 01:31:54 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:28 -0500
commite372c41401993b45c721c4d92730e7e0a79f7c1b (patch)
tree8f062f506c0578fc83b7d05c8751a7ccac96e50e /net/wireless
parent097e66c578459f79e3a2128c54e9df5194e1419a (diff)
[NET]: Consolidate net namespace related proc files creation.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/wext.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/net/wireless/wext.c b/net/wireless/wext.c
index db03ed5ce055..1e4cf615f878 100644
--- a/net/wireless/wext.c
+++ b/net/wireless/wext.c
@@ -673,26 +673,8 @@ static const struct seq_operations wireless_seq_ops = {
673 673
674static int wireless_seq_open(struct inode *inode, struct file *file) 674static int wireless_seq_open(struct inode *inode, struct file *file)
675{ 675{
676 struct seq_file *seq; 676 return seq_open_net(inode, file, &wireless_seq_ops,
677 int res; 677 sizeof(struct seq_net_private));
678 res = seq_open(file, &wireless_seq_ops);
679 if (!res) {
680 seq = file->private_data;
681 seq->private = get_proc_net(inode);
682 if (!seq->private) {
683 seq_release(inode, file);
684 res = -ENXIO;
685 }
686 }
687 return res;
688}
689
690static int wireless_seq_release(struct inode *inode, struct file *file)
691{
692 struct seq_file *seq = file->private_data;
693 struct net *net = seq->private;
694 put_net(net);
695 return seq_release(inode, file);
696} 678}
697 679
698static const struct file_operations wireless_seq_fops = { 680static const struct file_operations wireless_seq_fops = {
@@ -700,7 +682,7 @@ static const struct file_operations wireless_seq_fops = {
700 .open = wireless_seq_open, 682 .open = wireless_seq_open,
701 .read = seq_read, 683 .read = seq_read,
702 .llseek = seq_lseek, 684 .llseek = seq_lseek,
703 .release = wireless_seq_release, 685 .release = seq_release_net,
704}; 686};
705 687
706int wext_proc_init(struct net *net) 688int wext_proc_init(struct net *net)