diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-17 09:50:32 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-18 04:21:26 +0200 |
commit | ead81cc5fc6d996db6afb20f211241612610a07a (patch) | |
tree | 5ffc3c7960f6ba755fe6e44eda0b82cdb8209180 /net/sched/sch_generic.c | |
parent | pkt_sched: Kill qdisc_lock_tree usage in cls_route.c (diff) | |
download | linux-ead81cc5fc6d996db6afb20f211241612610a07a.tar.xz linux-ead81cc5fc6d996db6afb20f211241612610a07a.zip |
netdevice: Move qdisc_list back into net_device proper.
And give it it's own lock.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/sched/sch_generic.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index efa418a1b34e..8cdf0b4a6a5a 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -563,11 +563,15 @@ static void __qdisc_destroy(struct rcu_head *head) void qdisc_destroy(struct Qdisc *qdisc) { + struct net_device *dev = qdisc_dev(qdisc); + if (qdisc->flags & TCQ_F_BUILTIN || !atomic_dec_and_test(&qdisc->refcnt)) return; + spin_lock_bh(&dev->qdisc_list_lock); list_del(&qdisc->list); + spin_unlock_bh(&dev->qdisc_list_lock); call_rcu(&qdisc->q_rcu, __qdisc_destroy); } @@ -599,7 +603,9 @@ static void attach_one_default_qdisc(struct net_device *dev, printk(KERN_INFO "%s: activation failed\n", dev->name); return; } - list_add_tail(&qdisc->list, &dev_queue->qdisc_list); + spin_lock_bh(&dev->qdisc_list_lock); + list_add_tail(&qdisc->list, &dev->qdisc_list); + spin_unlock_bh(&dev->qdisc_list_lock); } else { qdisc = &noqueue_qdisc; } @@ -738,7 +744,6 @@ static void dev_init_scheduler_queue(struct net_device *dev, dev_queue->qdisc = qdisc; dev_queue->qdisc_sleeping = qdisc; - INIT_LIST_HEAD(&dev_queue->qdisc_list); } void dev_init_scheduler(struct net_device *dev) |