Skip to content

Commit aee18a8

Browse files
kaberdavem330
authored andcommitted
net-sched: sch_htb: remove write-only qdisc filter_cnt
The filter_cnt is supposed to count filter references to a class. Since the qdisc can't be the target of a filter, it doesn't need a filter_cnt. In fact the counter is never decreased since cls_api considers a return value of zero a failure and doesn't unbind again. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4207759 commit aee18a8

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

‎net/sched/sch_htb.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ struct htb_sched {
159159

160160
/* filters for qdisc itself */
161161
struct tcf_proto *filter_list;
162-
int filter_cnt;
163162

164163
int rate2quantum; /* quant = rate / rate2quantum */
165164
psched_time_t now; /* cached dequeue time */
@@ -1484,7 +1483,6 @@ static struct tcf_proto **htb_find_tcf(struct Qdisc *sch, unsigned long arg)
14841483
static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
14851484
u32 classid)
14861485
{
1487-
struct htb_sched *q = qdisc_priv(sch);
14881486
struct htb_class *cl = htb_find(classid, sch);
14891487

14901488
/*if (cl && !cl->level) return 0;
@@ -1498,20 +1496,15 @@ static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
14981496
*/
14991497
if (cl)
15001498
cl->filter_cnt++;
1501-
else
1502-
q->filter_cnt++;
15031499
return (unsigned long)cl;
15041500
}
15051501

15061502
static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg)
15071503
{
1508-
struct htb_sched *q = qdisc_priv(sch);
15091504
struct htb_class *cl = (struct htb_class *)arg;
15101505

15111506
if (cl)
15121507
cl->filter_cnt--;
1513-
else
1514-
q->filter_cnt--;
15151508
}
15161509

15171510
static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)

0 commit comments

Comments
 (0)