Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b94c8afc authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c19d0369
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -102,7 +102,8 @@ static int atm_tc_graft(struct Qdisc *sch, unsigned long arg,
		return -EINVAL;
	if (!new)
		new = &noop_qdisc;
	*old = xchg(&flow->q, new);
	*old = flow->q;
	flow->q = new;
	if (*old)
		qdisc_reset(*old);
	return 0;
+4 −3
Original line number Diff line number Diff line
@@ -1635,7 +1635,8 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
#endif
		}
		sch_tree_lock(sch);
		*old = xchg(&cl->q, new);
		*old = cl->q;
		cl->q = new;
		qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
		qdisc_reset(*old);
		sch_tree_unlock(sch);
@@ -1776,8 +1777,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
			cbq_deactivate_class(cl);

		if (rtab) {
			rtab = xchg(&cl->R_tab, rtab);
			qdisc_put_rtab(rtab);
			qdisc_put_rtab(cl->R_tab);
			cl->R_tab = rtab;
		}

		if (tb[TCA_CBQ_LSSOPT])
+2 −1
Original line number Diff line number Diff line
@@ -208,7 +208,8 @@ static int drr_graft_class(struct Qdisc *sch, unsigned long arg,

	sch_tree_lock(sch);
	drr_purge_queue(cl);
	*old = xchg(&cl->qdisc, new);
	*old = cl->qdisc;
	cl->qdisc = new;
	sch_tree_unlock(sch);
	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
	}

	sch_tree_lock(sch);
	*old = xchg(&p->q, new);
	*old = p->q;
	p->q = new;
	qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
	qdisc_reset(*old);
	sch_tree_unlock(sch);
+2 −1
Original line number Diff line number Diff line
@@ -1202,7 +1202,8 @@ hfsc_graft_class(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,

	sch_tree_lock(sch);
	hfsc_purge_queue(sch, cl);
	*old = xchg(&cl->qdisc, new);
	*old = cl->qdisc;
	cl->qdisc = new;
	sch_tree_unlock(sch);
	return 0;
}
Loading