aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_multiq.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-11-20 07:11:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 07:11:36 -0500
commitb94c8afcba3ae6584653b98e315446ea83be6ea5 (patch)
tree377fcfaf74e3aa38243c736a440e45b378355d8e /net/sched/sch_multiq.c
parentc19d0369d4c791d90fe0b84d6040a897fe25cc14 (diff)
pkt_sched: remove unnecessary xchg() in packet schedulers
The use of xchg() hasn't been necessary since 2.2.something when proper locking was added to packet schedulers. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_multiq.c')
-rw-r--r--net/sched/sch_multiq.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c
index f645ac55a1a1..7e151861794b 100644
--- a/net/sched/sch_multiq.c
+++ b/net/sched/sch_multiq.c
@@ -214,7 +214,8 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
214 q->bands = qopt->bands; 214 q->bands = qopt->bands;
215 for (i = q->bands; i < q->max_bands; i++) { 215 for (i = q->bands; i < q->max_bands; i++) {
216 if (q->queues[i] != &noop_qdisc) { 216 if (q->queues[i] != &noop_qdisc) {
217 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc); 217 struct Qdisc *child = q->queues[i];
218 q->queues[i] = &noop_qdisc;
218 qdisc_tree_decrease_qlen(child, child->q.qlen); 219 qdisc_tree_decrease_qlen(child, child->q.qlen);
219 qdisc_destroy(child); 220 qdisc_destroy(child);
220 } 221 }
@@ -224,7 +225,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
224 225
225 for (i = 0; i < q->bands; i++) { 226 for (i = 0; i < q->bands; i++) {
226 if (q->queues[i] == &noop_qdisc) { 227 if (q->queues[i] == &noop_qdisc) {
227 struct Qdisc *child; 228 struct Qdisc *child, *old;
228 child = qdisc_create_dflt(qdisc_dev(sch), 229 child = qdisc_create_dflt(qdisc_dev(sch),
229 sch->dev_queue, 230 sch->dev_queue,
230 &pfifo_qdisc_ops, 231 &pfifo_qdisc_ops,
@@ -232,12 +233,13 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
232 i + 1)); 233 i + 1));
233 if (child) { 234 if (child) {
234 sch_tree_lock(sch); 235 sch_tree_lock(sch);
235 child = xchg(&q->queues[i], child); 236 old = q->queues[i];
237 q->queues[i] = child;
236 238
237 if (child != &noop_qdisc) { 239 if (old != &noop_qdisc) {
238 qdisc_tree_decrease_qlen(child, 240 qdisc_tree_decrease_qlen(old,
239 child->q.qlen); 241 old->q.qlen);
240 qdisc_destroy(child); 242 qdisc_destroy(old);
241 } 243 }
242 sch_tree_unlock(sch); 244 sch_tree_unlock(sch);
243 } 245 }