Skip to content

Commit 74e3be6

Browse files
jpirkodavem330
authored andcommitted
net: sched: use tcf_block_q helper to get q pointer for sch_tree_lock
Use tcf_block_q helper to get q pointer to be used for direct call of sch_tree_lock/unlock instead of tcf_tree_lock/unlock. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1abf272 commit 74e3be6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎include/net/sch_generic.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@ static inline void sch_tree_unlock(const struct Qdisc *q)
359359
spin_unlock_bh(qdisc_root_sleeping_lock(q));
360360
}
361361

362-
#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)
363-
#define tcf_tree_unlock(tp) sch_tree_unlock((tp)->q)
364-
365362
extern struct Qdisc noop_qdisc;
366363
extern struct Qdisc_ops noop_qdisc_ops;
367364
extern struct Qdisc_ops pfifo_fast_ops;

‎net/sched/sch_api.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,9 +1661,11 @@ static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg)
16611661
struct tcf_bind_args *a = (void *)arg;
16621662

16631663
if (tp->ops->bind_class) {
1664-
tcf_tree_lock(tp);
1664+
struct Qdisc *q = tcf_block_q(tp->chain->block);
1665+
1666+
sch_tree_lock(q);
16651667
tp->ops->bind_class(n, a->classid, a->cl);
1666-
tcf_tree_unlock(tp);
1668+
sch_tree_unlock(q);
16671669
}
16681670
return 0;
16691671
}

0 commit comments

Comments
 (0)