aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index b1d2cfea89c5..e5569625d2a5 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -217,6 +217,14 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
217 return qdisc_lock(root); 217 return qdisc_lock(root);
218} 218}
219 219
220static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
221{
222 struct Qdisc *root = qdisc_root_sleeping(qdisc);
223
224 ASSERT_RTNL();
225 return qdisc_lock(root);
226}
227
220static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) 228static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
221{ 229{
222 return qdisc->dev_queue->dev; 230 return qdisc->dev_queue->dev;
@@ -224,12 +232,12 @@ static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
224 232
225static inline void sch_tree_lock(struct Qdisc *q) 233static inline void sch_tree_lock(struct Qdisc *q)
226{ 234{
227 spin_lock_bh(qdisc_root_lock(q)); 235 spin_lock_bh(qdisc_root_sleeping_lock(q));
228} 236}
229 237
230static inline void sch_tree_unlock(struct Qdisc *q) 238static inline void sch_tree_unlock(struct Qdisc *q)
231{ 239{
232 spin_unlock_bh(qdisc_root_lock(q)); 240 spin_unlock_bh(qdisc_root_sleeping_lock(q));
233} 241}
234 242
235#define tcf_tree_lock(tp) sch_tree_lock((tp)->q) 243#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)