]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/pppoe.c
serial167: prepare to push BKL down into drivers
[linux-2.6-omap-h63xx.git] / drivers / net / pppoe.c
index 8936ed3469cf0744a68ace9e205ea6a804ce3b85..58a26a47af29a1ee3764968dda5e7497752c9e7a 100644 (file)
@@ -301,7 +301,7 @@ static int pppoe_device_event(struct notifier_block *this,
 {
        struct net_device *dev = (struct net_device *) ptr;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                return NOTIFY_DONE;
 
        /* Only look at sockets that are using this specific device. */
@@ -392,7 +392,7 @@ static int pppoe_rcv(struct sk_buff *skb,
        if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
                goto out;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                goto drop;
 
        if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
@@ -424,7 +424,7 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
        struct pppoe_hdr *ph;
        struct pppox_sock *po;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                goto abort;
 
        if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
@@ -491,7 +491,7 @@ static int pppoe_create(struct net *net, struct socket *sock)
        int error = -ENOMEM;
        struct sock *sk;
 
-       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto, 1);
+       sk = sk_alloc(net, PF_PPPOX, GFP_KERNEL, &pppoe_sk_proto);
        if (!sk)
                goto out;
 
@@ -989,6 +989,7 @@ out:
 }
 
 static void *pppoe_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(pppoe_hash_lock)
 {
        loff_t l = *pos;
 
@@ -1022,6 +1023,7 @@ out:
 }
 
 static void pppoe_seq_stop(struct seq_file *seq, void *v)
+       __releases(pppoe_hash_lock)
 {
        read_unlock_bh(&pppoe_hash_lock);
 }
@@ -1050,11 +1052,9 @@ static int __init pppoe_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("pppoe", S_IRUGO, init_net.proc_net);
+       p = proc_net_fops_create(&init_net, "pppoe", S_IRUGO, &pppoe_seq_fops);
        if (!p)
                return -ENOMEM;
-
-       p->proc_fops = &pppoe_seq_fops;
        return 0;
 }
 #else /* CONFIG_PROC_FS */