summaryrefslogtreecommitdiffstats
path: root/drivers/net/pppoe.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-01-26 21:11:02 -0800
committerDavid S. Miller <davem@davemloft.net>2009-01-26 21:11:02 -0800
commit3617aa485c7394e20fdaf356b1b78516fcaaa0d1 (patch)
treeab7decb45c662db1ba19664fa686ef61c2b8e820 /drivers/net/pppoe.c
parentcbec6605cf0fd5080f03eb787c95c1ecd660421f (diff)
downloadlinux-3617aa485c7394e20fdaf356b1b78516fcaaa0d1.tar.bz2
net: pppoe - stop using proc internals
Alexey Dobriyan pointed that using PDE_NET outside the proc code is plain bogus (thanks Alexey!). Fix it. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppoe.c')
-rw-r--r--drivers/net/pppoe.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 798b8cf5f9a6..074803a78fc6 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -1040,7 +1040,7 @@ out:
static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(pn->hash_lock)
{
- struct pppoe_net *pn = pppoe_pernet(seq->private);
+ struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq));
loff_t l = *pos;
read_lock_bh(&pn->hash_lock);
@@ -1049,7 +1049,7 @@ static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
- struct pppoe_net *pn = pppoe_pernet(seq->private);
+ struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq));
struct pppox_sock *po;
++*pos;
@@ -1077,7 +1077,7 @@ out:
static void pppoe_seq_stop(struct seq_file *seq, void *v)
__releases(pn->hash_lock)
{
- struct pppoe_net *pn = pppoe_pernet(seq->private);
+ struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq));
read_unlock_bh(&pn->hash_lock);
}
@@ -1090,30 +1090,8 @@ static const struct seq_operations pppoe_seq_ops = {
static int pppoe_seq_open(struct inode *inode, struct file *file)
{
- struct seq_file *m;
- struct net *net;
- int err;
-
- err = seq_open(file, &pppoe_seq_ops);
- if (err)
- return err;
-
- m = file->private_data;
- net = maybe_get_net(PDE_NET(PDE(inode)));
- BUG_ON(!net);
- m->private = net;
-
- return err;
-}
-
-static int pppoe_seq_release(struct inode *inode, struct file *file)
-{
- struct seq_file *m;
-
- m = file->private_data;
- put_net((struct net*)m->private);
-
- return seq_release(inode, file);
+ return seq_open_net(inode, file, &pppoe_seq_ops,
+ sizeof(struct seq_net_private));
}
static const struct file_operations pppoe_seq_fops = {
@@ -1121,7 +1099,7 @@ static const struct file_operations pppoe_seq_fops = {
.open = pppoe_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = pppoe_seq_release,
+ .release = seq_release_net,
};
#endif /* CONFIG_PROC_FS */