mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[NET]: Consolidate net namespace related proc files creation.
Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
097e66c578
commit
e372c41401
8 changed files with 80 additions and 139 deletions
|
|
@ -673,26 +673,8 @@ static const struct seq_operations wireless_seq_ops = {
|
|||
|
||||
static int wireless_seq_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct seq_file *seq;
|
||||
int res;
|
||||
res = seq_open(file, &wireless_seq_ops);
|
||||
if (!res) {
|
||||
seq = file->private_data;
|
||||
seq->private = get_proc_net(inode);
|
||||
if (!seq->private) {
|
||||
seq_release(inode, file);
|
||||
res = -ENXIO;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int wireless_seq_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct seq_file *seq = file->private_data;
|
||||
struct net *net = seq->private;
|
||||
put_net(net);
|
||||
return seq_release(inode, file);
|
||||
return seq_open_net(inode, file, &wireless_seq_ops,
|
||||
sizeof(struct seq_net_private));
|
||||
}
|
||||
|
||||
static const struct file_operations wireless_seq_fops = {
|
||||
|
|
@ -700,7 +682,7 @@ static const struct file_operations wireless_seq_fops = {
|
|||
.open = wireless_seq_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = wireless_seq_release,
|
||||
.release = seq_release_net,
|
||||
};
|
||||
|
||||
int wext_proc_init(struct net *net)
|
||||
|
|
|
|||
Loading…
Reference in a new issue