diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sch_generic.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index b2a8e6338576..4dba2663eaed 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -698,6 +698,23 @@ static inline void qdisc_reset_queue(struct Qdisc *sch) sch->qstats.backlog = 0; } +static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new, + struct Qdisc **pold) +{ + struct Qdisc *old; + + sch_tree_lock(sch); + old = *pold; + *pold = new; + if (old != NULL) { + qdisc_tree_decrease_qlen(old, old->q.qlen); + qdisc_reset(old); + } + sch_tree_unlock(sch); + + return old; +} + static inline unsigned int __qdisc_queue_drop(struct Qdisc *sch, struct sk_buff_head *list) { |