aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-08 20:06:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-08 20:06:30 -0400
commit5ce2d488fe039ddd86a638496cf704df86c74eeb (patch)
tree71b4d982bfa8bd457bb41c0693c0e70d75b524b4 /net/sched/sch_htb.c
parentbb949fbd1878973c3539d9aecff52f284482a937 (diff)
pkt_sched: Remove 'dev' member of struct Qdisc.
It can be obtained via the netdev_queue. So create a helper routine, qdisc_dev(), to make the transformations nicer looking. Now, qdisc_alloc() now no longer needs a net_device pointer argument. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r--net/sched/sch_htb.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 956a67f66b9c..31f7d1536e6d 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1026,7 +1026,7 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
1026 qdisc_watchdog_init(&q->watchdog, sch); 1026 qdisc_watchdog_init(&q->watchdog, sch);
1027 skb_queue_head_init(&q->direct_queue); 1027 skb_queue_head_init(&q->direct_queue);
1028 1028
1029 q->direct_qlen = sch->dev->tx_queue_len; 1029 q->direct_qlen = qdisc_dev(sch)->tx_queue_len;
1030 if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */ 1030 if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */
1031 q->direct_qlen = 2; 1031 q->direct_qlen = 2;
1032 1032
@@ -1043,7 +1043,7 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
1043 struct nlattr *nest; 1043 struct nlattr *nest;
1044 struct tc_htb_glob gopt; 1044 struct tc_htb_glob gopt;
1045 1045
1046 spin_lock_bh(&sch->dev->queue_lock); 1046 spin_lock_bh(&qdisc_dev(sch)->queue_lock);
1047 1047
1048 gopt.direct_pkts = q->direct_pkts; 1048 gopt.direct_pkts = q->direct_pkts;
1049 gopt.version = HTB_VER; 1049 gopt.version = HTB_VER;
@@ -1057,11 +1057,11 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
1057 NLA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt); 1057 NLA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt);
1058 nla_nest_end(skb, nest); 1058 nla_nest_end(skb, nest);
1059 1059
1060 spin_unlock_bh(&sch->dev->queue_lock); 1060 spin_unlock_bh(&qdisc_dev(sch)->queue_lock);
1061 return skb->len; 1061 return skb->len;
1062 1062
1063nla_put_failure: 1063nla_put_failure:
1064 spin_unlock_bh(&sch->dev->queue_lock); 1064 spin_unlock_bh(&qdisc_dev(sch)->queue_lock);
1065 nla_nest_cancel(skb, nest); 1065 nla_nest_cancel(skb, nest);
1066 return -1; 1066 return -1;
1067} 1067}
@@ -1073,7 +1073,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
1073 struct nlattr *nest; 1073 struct nlattr *nest;
1074 struct tc_htb_opt opt; 1074 struct tc_htb_opt opt;
1075 1075
1076 spin_lock_bh(&sch->dev->queue_lock); 1076 spin_lock_bh(&qdisc_dev(sch)->queue_lock);
1077 tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT; 1077 tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT;
1078 tcm->tcm_handle = cl->common.classid; 1078 tcm->tcm_handle = cl->common.classid;
1079 if (!cl->level && cl->un.leaf.q) 1079 if (!cl->level && cl->un.leaf.q)
@@ -1095,11 +1095,11 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
1095 NLA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt); 1095 NLA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt);
1096 1096
1097 nla_nest_end(skb, nest); 1097 nla_nest_end(skb, nest);
1098 spin_unlock_bh(&sch->dev->queue_lock); 1098 spin_unlock_bh(&qdisc_dev(sch)->queue_lock);
1099 return skb->len; 1099 return skb->len;
1100 1100
1101nla_put_failure: 1101nla_put_failure:
1102 spin_unlock_bh(&sch->dev->queue_lock); 1102 spin_unlock_bh(&qdisc_dev(sch)->queue_lock);
1103 nla_nest_cancel(skb, nest); 1103 nla_nest_cancel(skb, nest);
1104 return -1; 1104 return -1;
1105} 1105}
@@ -1129,7 +1129,7 @@ static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
1129 1129
1130 if (cl && !cl->level) { 1130 if (cl && !cl->level) {
1131 if (new == NULL && 1131 if (new == NULL &&
1132 (new = qdisc_create_dflt(sch->dev, sch->dev_queue, 1132 (new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
1133 &pfifo_qdisc_ops, 1133 &pfifo_qdisc_ops,
1134 cl->common.classid)) 1134 cl->common.classid))
1135 == NULL) 1135 == NULL)
@@ -1257,7 +1257,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
1257 return -EBUSY; 1257 return -EBUSY;
1258 1258
1259 if (!cl->level && htb_parent_last_child(cl)) { 1259 if (!cl->level && htb_parent_last_child(cl)) {
1260 new_q = qdisc_create_dflt(sch->dev, sch->dev_queue, 1260 new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
1261 &pfifo_qdisc_ops, 1261 &pfifo_qdisc_ops,
1262 cl->parent->common.classid); 1262 cl->parent->common.classid);
1263 last_child = 1; 1263 last_child = 1;
@@ -1365,7 +1365,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1365 goto failure; 1365 goto failure;
1366 1366
1367 gen_new_estimator(&cl->bstats, &cl->rate_est, 1367 gen_new_estimator(&cl->bstats, &cl->rate_est,
1368 &sch->dev->queue_lock, 1368 &qdisc_dev(sch)->queue_lock,
1369 tca[TCA_RATE] ? : &est.nla); 1369 tca[TCA_RATE] ? : &est.nla);
1370 cl->refcnt = 1; 1370 cl->refcnt = 1;
1371 cl->children = 0; 1371 cl->children = 0;
@@ -1378,7 +1378,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1378 /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL) 1378 /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL)
1379 so that can't be used inside of sch_tree_lock 1379 so that can't be used inside of sch_tree_lock
1380 -- thanks to Karlis Peisenieks */ 1380 -- thanks to Karlis Peisenieks */
1381 new_q = qdisc_create_dflt(sch->dev, sch->dev_queue, 1381 new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
1382 &pfifo_qdisc_ops, classid); 1382 &pfifo_qdisc_ops, classid);
1383 sch_tree_lock(sch); 1383 sch_tree_lock(sch);
1384 if (parent && !parent->level) { 1384 if (parent && !parent->level) {
@@ -1420,7 +1420,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1420 } else { 1420 } else {
1421 if (tca[TCA_RATE]) 1421 if (tca[TCA_RATE])
1422 gen_replace_estimator(&cl->bstats, &cl->rate_est, 1422 gen_replace_estimator(&cl->bstats, &cl->rate_est,
1423 &sch->dev->queue_lock, 1423 &qdisc_dev(sch)->queue_lock,
1424 tca[TCA_RATE]); 1424 tca[TCA_RATE]);
1425 sch_tree_lock(sch); 1425 sch_tree_lock(sch);
1426 } 1426 }