document some kernel patches
[openwrt.git] / openwrt / package / linux / kernel-patches / 204-net_sched_sched_api_c.patch
1 --- linux-2.4.30/net/sched/sch_api.c 2004-11-17 12:54:22.000000000 +0100
2 +++ linux-2.4.30-wl/net/sched/sch_api.c 2005-04-24 18:56:03.000000000 +0200
3 @@ -194,11 +194,12 @@
4 {
5 struct Qdisc *q;
6
7 - list_for_each_entry(q, &dev->qdisc_list, list) {
8 + for (q = dev->qdisc_list; q; q = q->next) {
9 if (q->handle == handle)
10 return q;
11 }
12 return NULL;
13 +
14 }
15
16 struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
17 @@ -371,8 +372,6 @@
18 unsigned long cl = cops->get(parent, classid);
19 if (cl) {
20 err = cops->graft(parent, cl, new, old);
21 - if (new)
22 - new->parent = classid;
23 cops->put(parent, cl);
24 }
25 }
26 @@ -427,7 +426,6 @@
27
28 memset(sch, 0, size);
29
30 - INIT_LIST_HEAD(&sch->list);
31 skb_queue_head_init(&sch->q);
32
33 if (handle == TC_H_INGRESS)
34 @@ -453,7 +451,8 @@
35
36 if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
37 write_lock(&qdisc_tree_lock);
38 - list_add_tail(&sch->list, &dev->qdisc_list);
39 + sch->next = dev->qdisc_list;
40 + dev->qdisc_list = sch;
41 write_unlock(&qdisc_tree_lock);
42 #ifdef CONFIG_NET_ESTIMATOR
43 if (tca[TCA_RATE-1])
44 @@ -808,19 +807,16 @@
45 if (idx > s_idx)
46 s_q_idx = 0;
47 read_lock(&qdisc_tree_lock);
48 - q_idx = 0;
49 - list_for_each_entry(q, &dev->qdisc_list, list) {
50 - if (q_idx < s_q_idx) {
51 - q_idx++;
52 - continue;
53 - }
54 - if (tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid,
55 - cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
56 - read_unlock(&qdisc_tree_lock);
57 - goto done;
58 - }
59 - q_idx++;
60 - }
61 + for (q = dev->qdisc_list, q_idx = 0; q;
62 + q = q->next, q_idx++) {
63 + if (q_idx < s_q_idx)
64 + continue;
65 + if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid,
66 + cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
67 + read_unlock(&qdisc_tree_lock);
68 + goto done;
69 + }
70 + }
71 read_unlock(&qdisc_tree_lock);
72 }
73
74 @@ -1033,27 +1029,24 @@
75 t = 0;
76
77 read_lock(&qdisc_tree_lock);
78 - list_for_each_entry(q, &dev->qdisc_list, list) {
79 - if (t < s_t || !q->ops->cl_ops ||
80 - (tcm->tcm_parent &&
81 - TC_H_MAJ(tcm->tcm_parent) != q->handle)) {
82 - t++;
83 - continue;
84 - }
85 - if (t > s_t)
86 - memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
87 - arg.w.fn = qdisc_class_dump;
88 - arg.skb = skb;
89 - arg.cb = cb;
90 - arg.w.stop = 0;
91 - arg.w.skip = cb->args[1];
92 - arg.w.count = 0;
93 - q->ops->cl_ops->walk(q, &arg.w);
94 - cb->args[1] = arg.w.count;
95 - if (arg.w.stop)
96 - break;
97 - t++;
98 - }
99 + for (q=dev->qdisc_list, t=0; q; q = q->next, t++) {
100 + if (t < s_t) continue;
101 + if (!q->ops->cl_ops) continue;
102 + if (tcm->tcm_parent && TC_H_MAJ(tcm->tcm_parent) != q->handle)
103 + continue;
104 + if (t > s_t)
105 + memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
106 + arg.w.fn = qdisc_class_dump;
107 + arg.skb = skb;
108 + arg.cb = cb;
109 + arg.w.stop = 0;
110 + arg.w.skip = cb->args[1];
111 + arg.w.count = 0;
112 + q->ops->cl_ops->walk(q, &arg.w);
113 + cb->args[1] = arg.w.count;
114 + if (arg.w.stop)
115 + break;
116 + }
117 read_unlock(&qdisc_tree_lock);
118
119 cb->args[0] = t;
This page took 0.043227 seconds and 5 git commands to generate.