- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / net / sched / sch_api.c
index 903e418..75fd1c6 100644 (file)
@@ -947,7 +947,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
        struct Qdisc *p = NULL;
        int err;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return -EINVAL;
 
        if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
@@ -1009,7 +1009,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
        struct Qdisc *q, *p;
        int err;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return -EINVAL;
 
 replay:
@@ -1179,7 +1179,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
                goto nla_put_failure;
 
        if (gnet_stats_copy_basic(&d, &q->bstats) < 0 ||
-           gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 ||
+           gnet_stats_copy_rate_est(&d, &q->bstats, &q->rate_est) < 0 ||
            gnet_stats_copy_queue(&d, &q->qstats) < 0)
                goto nla_put_failure;
 
@@ -1274,14 +1274,15 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
        int s_idx, s_q_idx;
        struct net_device *dev;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return 0;
 
        s_idx = cb->args[0];
        s_q_idx = q_idx = cb->args[1];
-       read_lock(&dev_base_lock);
+
+       rcu_read_lock();
        idx = 0;
-       for_each_netdev(&init_net, dev) {
+       for_each_netdev_rcu(&init_net, dev) {
                struct netdev_queue *dev_queue;
 
                if (idx < s_idx)
@@ -1302,7 +1303,7 @@ cont:
        }
 
 done:
-       read_unlock(&dev_base_lock);
+       rcu_read_unlock();
 
        cb->args[0] = idx;
        cb->args[1] = q_idx;
@@ -1333,7 +1334,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
        u32 qid = TC_H_MAJ(clid);
        int err;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return -EINVAL;
 
        if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
@@ -1575,7 +1576,7 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
        struct net_device *dev;
        int t, s_t;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return 0;
 
        if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm)))