diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-08-11 02:33:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:31 -0400 |
commit | 9ac961ee05bfc837e5271be34ad7158e90dce7d9 (patch) | |
tree | da3c748809f3854fa69a1fc9fba86e52a5c083ca /net/sched | |
parent | 3bf72957d2a553c343e4285463ef0a88139bdec4 (diff) |
[HTB]: Remove lock macro.
Get rid of the macro's being used to obscure the locking.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_htb.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 73094e7f4169..c0b80b75cdff 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -72,8 +72,6 @@ | |||
72 | #define HTB_EWMAC 2 /* rate average over HTB_EWMAC*HTB_HSIZE sec */ | 72 | #define HTB_EWMAC 2 /* rate average over HTB_EWMAC*HTB_HSIZE sec */ |
73 | #define HTB_RATECM 1 /* whether to use rate computer */ | 73 | #define HTB_RATECM 1 /* whether to use rate computer */ |
74 | #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ | 74 | #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ |
75 | #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock) | ||
76 | #define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock) | ||
77 | #define HTB_VER 0x30011 /* major must be matched with number suplied by TC as version */ | 75 | #define HTB_VER 0x30011 /* major must be matched with number suplied by TC as version */ |
78 | 76 | ||
79 | #if HTB_VER >> 16 != TC_HTB_PROTOVER | 77 | #if HTB_VER >> 16 != TC_HTB_PROTOVER |
@@ -667,7 +665,7 @@ static void htb_rate_timer(unsigned long arg) | |||
667 | struct list_head *p; | 665 | struct list_head *p; |
668 | 666 | ||
669 | /* lock queue so that we can muck with it */ | 667 | /* lock queue so that we can muck with it */ |
670 | HTB_QLOCK(sch); | 668 | spin_lock_bh(&sch->dev->queue_lock); |
671 | 669 | ||
672 | q->rttim.expires = jiffies + HZ; | 670 | q->rttim.expires = jiffies + HZ; |
673 | add_timer(&q->rttim); | 671 | add_timer(&q->rttim); |
@@ -681,7 +679,7 @@ static void htb_rate_timer(unsigned long arg) | |||
681 | RT_GEN (cl->sum_bytes,cl->rate_bytes); | 679 | RT_GEN (cl->sum_bytes,cl->rate_bytes); |
682 | RT_GEN (cl->sum_packets,cl->rate_packets); | 680 | RT_GEN (cl->sum_packets,cl->rate_packets); |
683 | } | 681 | } |
684 | HTB_QUNLOCK(sch); | 682 | spin_unlock_bh(&sch->dev->queue_lock); |
685 | } | 683 | } |
686 | #endif | 684 | #endif |
687 | 685 | ||
@@ -1089,7 +1087,7 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
1089 | unsigned char *b = skb->tail; | 1087 | unsigned char *b = skb->tail; |
1090 | struct rtattr *rta; | 1088 | struct rtattr *rta; |
1091 | struct tc_htb_glob gopt; | 1089 | struct tc_htb_glob gopt; |
1092 | HTB_QLOCK(sch); | 1090 | spin_lock_bh(&sch->dev->queue_lock); |
1093 | gopt.direct_pkts = q->direct_pkts; | 1091 | gopt.direct_pkts = q->direct_pkts; |
1094 | 1092 | ||
1095 | gopt.version = HTB_VER; | 1093 | gopt.version = HTB_VER; |
@@ -1100,10 +1098,10 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
1100 | RTA_PUT(skb, TCA_OPTIONS, 0, NULL); | 1098 | RTA_PUT(skb, TCA_OPTIONS, 0, NULL); |
1101 | RTA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt); | 1099 | RTA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt); |
1102 | rta->rta_len = skb->tail - b; | 1100 | rta->rta_len = skb->tail - b; |
1103 | HTB_QUNLOCK(sch); | 1101 | spin_unlock_bh(&sch->dev->queue_lock); |
1104 | return skb->len; | 1102 | return skb->len; |
1105 | rtattr_failure: | 1103 | rtattr_failure: |
1106 | HTB_QUNLOCK(sch); | 1104 | spin_unlock_bh(&sch->dev->queue_lock); |
1107 | skb_trim(skb, skb->tail - skb->data); | 1105 | skb_trim(skb, skb->tail - skb->data); |
1108 | return -1; | 1106 | return -1; |
1109 | } | 1107 | } |
@@ -1116,7 +1114,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
1116 | struct rtattr *rta; | 1114 | struct rtattr *rta; |
1117 | struct tc_htb_opt opt; | 1115 | struct tc_htb_opt opt; |
1118 | 1116 | ||
1119 | HTB_QLOCK(sch); | 1117 | spin_lock_bh(&sch->dev->queue_lock); |
1120 | tcm->tcm_parent = cl->parent ? cl->parent->classid : TC_H_ROOT; | 1118 | tcm->tcm_parent = cl->parent ? cl->parent->classid : TC_H_ROOT; |
1121 | tcm->tcm_handle = cl->classid; | 1119 | tcm->tcm_handle = cl->classid; |
1122 | if (!cl->level && cl->un.leaf.q) | 1120 | if (!cl->level && cl->un.leaf.q) |
@@ -1133,10 +1131,10 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
1133 | opt.level = cl->level; | 1131 | opt.level = cl->level; |
1134 | RTA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt); | 1132 | RTA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt); |
1135 | rta->rta_len = skb->tail - b; | 1133 | rta->rta_len = skb->tail - b; |
1136 | HTB_QUNLOCK(sch); | 1134 | spin_unlock_bh(&sch->dev->queue_lock); |
1137 | return skb->len; | 1135 | return skb->len; |
1138 | rtattr_failure: | 1136 | rtattr_failure: |
1139 | HTB_QUNLOCK(sch); | 1137 | spin_unlock_bh(&sch->dev->queue_lock); |
1140 | skb_trim(skb, b - skb->data); | 1138 | skb_trim(skb, b - skb->data); |
1141 | return -1; | 1139 | return -1; |
1142 | } | 1140 | } |