aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_api.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2013-12-15 20:15:08 -0800
committerDavid S. Miller <davem@davemloft.net>2013-12-18 12:52:07 -0500
commit369ba56787d7469c0afda70bb9ff76ad5faaead5 (patch)
tree58425d3d564e3255c6660185bf22c80b76305ff5 /net/sched/act_api.c
parentnet_sched: cls: refactor out struct tcf_ext_map (diff)
downloadlinux-dev-369ba56787d7469c0afda70bb9ff76ad5faaead5.tar.xz
linux-dev-369ba56787d7469c0afda70bb9ff76ad5faaead5.zip
net_sched: init struct tcf_hashinfo at register time
It looks weird to store the lock out of the struct but still points to a static variable. Just move them into the struct. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r--net/sched/act_api.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 7d84183b633e..125673d5d877 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -34,9 +34,9 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)
for (p1p = &hinfo->htab[h]; *p1p; p1p = &(*p1p)->tcfc_next) {
if (*p1p == p) {
- write_lock_bh(hinfo->lock);
+ write_lock_bh(&hinfo->lock);
*p1p = p->tcfc_next;
- write_unlock_bh(hinfo->lock);
+ write_unlock_bh(&hinfo->lock);
gen_kill_estimator(&p->tcfc_bstats,
&p->tcfc_rate_est);
/*
@@ -77,7 +77,7 @@ static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb,
int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
struct nlattr *nest;
- read_lock_bh(hinfo->lock);
+ read_lock_bh(&hinfo->lock);
s_i = cb->args[0];
@@ -107,7 +107,7 @@ static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb,
}
}
done:
- read_unlock_bh(hinfo->lock);
+ read_unlock_bh(&hinfo->lock);
if (n_i)
cb->args[0] += n_i;
return n_i;
@@ -170,13 +170,13 @@ struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo)
{
struct tcf_common *p;
- read_lock_bh(hinfo->lock);
+ read_lock_bh(&hinfo->lock);
for (p = hinfo->htab[tcf_hash(index, hinfo->hmask)]; p;
p = p->tcfc_next) {
if (p->tcfc_index == index)
break;
}
- read_unlock_bh(hinfo->lock);
+ read_unlock_bh(&hinfo->lock);
return p;
}
@@ -257,10 +257,10 @@ void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo)
{
unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask);
- write_lock_bh(hinfo->lock);
+ write_lock_bh(&hinfo->lock);
p->tcfc_next = hinfo->htab[h];
hinfo->htab[h] = p;
- write_unlock_bh(hinfo->lock);
+ write_unlock_bh(&hinfo->lock);
}
EXPORT_SYMBOL(tcf_hash_insert);