X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsched%2Fsch_htb.c;h=72beb66cec9c2ad1a6e95f05f97c612972f7a6bc;hb=20fea08b5fb639c4c175b5c74a2bb346c5c5bc2e;hp=246a2f9765f1312c6f83092c31944db1bf9aaa1f;hpb=bc06cffdec85d487c77109dffcd2f285bdc502d3;p=linux-2.6 diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 246a2f9765..72beb66cec 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -132,10 +132,8 @@ struct htb_class { static inline long L2T(struct htb_class *cl, struct qdisc_rate_table *rate, int size) { - int slot = size >> rate->rate.cell_log; - if (slot > 255) - return (rate->data[255]*(slot >> 8) + rate->data[slot & 0xFF]); - return rate->data[slot]; + long result = qdisc_l2t(rate, size); + return result; } struct htb_sched { @@ -1531,7 +1529,7 @@ static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg) } } -static struct Qdisc_class_ops htb_class_ops = { +static const struct Qdisc_class_ops htb_class_ops = { .graft = htb_graft, .leaf = htb_leaf, .qlen_notify = htb_qlen_notify, @@ -1547,7 +1545,7 @@ static struct Qdisc_class_ops htb_class_ops = { .dump_stats = htb_dump_class_stats, }; -static struct Qdisc_ops htb_qdisc_ops = { +static struct Qdisc_ops htb_qdisc_ops __read_mostly = { .next = NULL, .cl_ops = &htb_class_ops, .id = "htb",