diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-08-27 05:22:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-27 05:22:07 -0400 |
commit | f7a54c13c7b072d9426bd5cec1cdb8306df5ef55 (patch) | |
tree | 12134183d09f0826e0488fd281e6c0b830270d37 /net/sched | |
parent | 666d9bbedfff7c2c37eab92e715641922dee6864 (diff) |
pkt_sched: Use rcu_assign_pointer() to change dev_queue->qdisc
These pointers are RCU protected, so proper primitives should be used.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_api.c | 2 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 341d558b6e39..ad9cda1b8c0a 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | |||
635 | if (qdisc == NULL) | 635 | if (qdisc == NULL) |
636 | qdisc = &noop_qdisc; | 636 | qdisc = &noop_qdisc; |
637 | dev_queue->qdisc_sleeping = qdisc; | 637 | dev_queue->qdisc_sleeping = qdisc; |
638 | dev_queue->qdisc = &noop_qdisc; | 638 | rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc); |
639 | 639 | ||
640 | spin_unlock_bh(root_lock); | 640 | spin_unlock_bh(root_lock); |
641 | 641 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 5f0ade7806a7..9634091ee2f0 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -634,7 +634,7 @@ static void dev_deactivate_queue(struct net_device *dev, | |||
634 | if (!(qdisc->flags & TCQ_F_BUILTIN)) | 634 | if (!(qdisc->flags & TCQ_F_BUILTIN)) |
635 | set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); | 635 | set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); |
636 | 636 | ||
637 | dev_queue->qdisc = qdisc_default; | 637 | rcu_assign_pointer(dev_queue->qdisc, qdisc_default); |
638 | qdisc_reset(qdisc); | 638 | qdisc_reset(qdisc); |
639 | 639 | ||
640 | spin_unlock_bh(qdisc_lock(qdisc)); | 640 | spin_unlock_bh(qdisc_lock(qdisc)); |
@@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev, | |||
709 | struct Qdisc *qdisc_default = _qdisc_default; | 709 | struct Qdisc *qdisc_default = _qdisc_default; |
710 | 710 | ||
711 | if (qdisc) { | 711 | if (qdisc) { |
712 | dev_queue->qdisc = qdisc_default; | 712 | rcu_assign_pointer(dev_queue->qdisc, qdisc_default); |
713 | dev_queue->qdisc_sleeping = qdisc_default; | 713 | dev_queue->qdisc_sleeping = qdisc_default; |
714 | 714 | ||
715 | qdisc_destroy(qdisc); | 715 | qdisc_destroy(qdisc); |