summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-08-27 02:22:07 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-27 02:22:07 -0700
commitf7a54c13c7b072d9426bd5cec1cdb8306df5ef55 (patch)
tree12134183d09f0826e0488fd281e6c0b830270d37 /net
parent666d9bbedfff7c2c37eab92e715641922dee6864 (diff)
downloadop-kernel-dev-f7a54c13c7b072d9426bd5cec1cdb8306df5ef55.zip
op-kernel-dev-f7a54c13c7b072d9426bd5cec1cdb8306df5ef55.tar.gz
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')
-rw-r--r--net/sched/sch_api.c2
-rw-r--r--net/sched/sch_generic.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 341d558..ad9cda1 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,
if (qdisc == NULL)
qdisc = &noop_qdisc;
dev_queue->qdisc_sleeping = qdisc;
- dev_queue->qdisc = &noop_qdisc;
+ rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc);
spin_unlock_bh(root_lock);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 5f0ade7..9634091 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,
if (!(qdisc->flags & TCQ_F_BUILTIN))
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
- dev_queue->qdisc = qdisc_default;
+ rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
qdisc_reset(qdisc);
spin_unlock_bh(qdisc_lock(qdisc));
@@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev,
struct Qdisc *qdisc_default = _qdisc_default;
if (qdisc) {
- dev_queue->qdisc = qdisc_default;
+ rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
dev_queue->qdisc_sleeping = qdisc_default;
qdisc_destroy(qdisc);
OpenPOWER on IntegriCloud