From: Patrick McHardy <kaber@trash.net>
To: netdev@vger.kernel.org
Cc: devik@cdi.cz, jarkao2@gmail.com
Subject: net-sched 07/06: sch_htb: remove write-only qdisc filter_cnt
Date: Fri, 04 Jul 2008 14:20:03 +0200 [thread overview]
Message-ID: <486E1573.8040303@trash.net> (raw)
In-Reply-To: <20080703151600.26225.3394.sendpatchset@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 07.diff --]
[-- Type: text/x-diff, Size: 1726 bytes --]
commit 50ed378778be0c8d435163122827cf513882a707
Author: Patrick McHardy <kaber@trash.net>
Date: Fri Jul 4 14:18:03 2008 +0200
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>
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 128a5ab..ee8b4ff 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -159,7 +159,6 @@ struct htb_sched {
/* filters for qdisc itself */
struct tcf_proto *filter_list;
- int filter_cnt;
int rate2quantum; /* quant = rate / rate2quantum */
psched_time_t now; /* cached dequeue time */
@@ -1484,7 +1483,6 @@ static struct tcf_proto **htb_find_tcf(struct Qdisc *sch, unsigned long arg)
static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
u32 classid)
{
- struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = htb_find(classid, sch);
/*if (cl && !cl->level) return 0;
@@ -1498,20 +1496,15 @@ static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
*/
if (cl)
cl->filter_cnt++;
- else
- q->filter_cnt++;
return (unsigned long)cl;
}
static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg)
{
- struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)arg;
if (cl)
cl->filter_cnt--;
- else
- q->filter_cnt--;
}
static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
next prev parent reply other threads:[~2008-07-04 12:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 15:16 net-sched 00/06: dynamically sized class hashes v2 Patrick McHardy
2008-07-03 15:16 ` net-sched 01/06: add dynamically sized qdisc class hash helpers Patrick McHardy
2008-07-03 15:16 ` net-sched 02/06: sch_hfsc: use dynamic " Patrick McHardy
2008-07-03 15:16 ` net-sched 03/06: sch_cbq: " Patrick McHardy
2008-07-03 15:16 ` net-sched 04/06: sch_htb: move hash and sibling list removal to htb_delete Patrick McHardy
2008-07-03 15:16 ` net-sched 05/06: sch_htb: use dynamic class hash helpers Patrick McHardy
2008-07-03 15:16 ` net-sched 06/06: sch_htb: remove child and sibling lists Patrick McHardy
2008-07-03 16:14 ` net-sched 00/06: dynamically sized class hashes v2 Jarek Poplawski
2008-07-03 16:09 ` Patrick McHardy
2008-07-03 16:46 ` Jarek Poplawski
2008-07-03 16:49 ` Patrick McHardy
2008-07-04 12:20 ` Patrick McHardy [this message]
2008-07-04 14:29 ` net-sched 07/06: sch_htb: remove write-only qdisc filter_cnt Jarek Poplawski
2008-07-06 6:28 ` David Miller
2008-07-06 6:28 ` net-sched 00/06: dynamically sized class hashes v2 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=486E1573.8040303@trash.net \
--to=kaber@trash.net \
--cc=devik@cdi.cz \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).