pkt_sched: Kill stats_lock member of struct Qdisc.
authorDavid S. Miller <davem@davemloft.net>
Wed, 9 Jul 2008 05:57:31 +0000 (22:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jul 2008 05:57:31 +0000 (22:57 -0700)
It is always equal to qdisc->dev_queue->lock

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
net/sched/sch_api.c
net/sched/sch_generic.c

index 66ec36d8ac9780a42fc1605d8e1228952883f8aa..ea71705e9c77e267add1e7e087015dff5d3131a0 100644 (file)
@@ -43,7 +43,6 @@ struct Qdisc
        struct gnet_stats_basic bstats;
        struct gnet_stats_queue qstats;
        struct gnet_stats_rate_est      rate_est;
-       spinlock_t              *stats_lock;
        struct rcu_head         q_rcu;
        int                     (*reshape_fail)(struct sk_buff *skb,
                                        struct Qdisc *q);
index 4003c280b69f997f3da0e4cf8d134f13c58dfab9..e73bd68aa7aedc4c4baa4c6c874c670edfbd9dea 100644 (file)
@@ -604,7 +604,6 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
 
        sch->parent = parent;
 
-       sch->stats_lock = &dev_queue->lock;
        if (handle == TC_H_INGRESS) {
                sch->flags |= TCQ_F_INGRESS;
                handle = TC_H_MAKE(TC_H_INGRESS, 0);
@@ -622,7 +621,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue,
        if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS])) == 0) {
                if (tca[TCA_RATE]) {
                        err = gen_new_estimator(&sch->bstats, &sch->rate_est,
-                                               sch->stats_lock,
+                                               &sch->dev_queue->lock,
                                                tca[TCA_RATE]);
                        if (err) {
                                /*
@@ -664,7 +663,7 @@ static int qdisc_change(struct Qdisc *sch, struct nlattr **tca)
        }
        if (tca[TCA_RATE])
                gen_replace_estimator(&sch->bstats, &sch->rate_est,
-                       sch->stats_lock, tca[TCA_RATE]);
+                                     &sch->dev_queue->lock, tca[TCA_RATE]);
        return 0;
 }
 
@@ -954,7 +953,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
        q->qstats.qlen = q->q.qlen;
 
        if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
-                       TCA_XSTATS, q->stats_lock, &d) < 0)
+                                        TCA_XSTATS, &q->dev_queue->lock, &d) < 0)
                goto nla_put_failure;
 
        if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0)
@@ -1203,7 +1202,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
                goto nla_put_failure;
 
        if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
-                       TCA_XSTATS, q->stats_lock, &d) < 0)
+                                        TCA_XSTATS, &q->dev_queue->lock, &d) < 0)
                goto nla_put_failure;
 
        if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0)
index 3223e5ba76aaca1607e95336150526bdfc10b46a..dda78ee314ec9bc79b03fbe03c81a0a799c5affa 100644 (file)
@@ -484,7 +484,6 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev,
        sch = qdisc_alloc(dev_queue, ops);
        if (IS_ERR(sch))
                goto errout;
-       sch->stats_lock = &dev_queue->lock;
        sch->parent = parentid;
 
        if (!ops->init || ops->init(sch, NULL) == 0)