Commit 55a97ece authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: tc actions: remove unnecessary locking for refcnt changes

refcnt/bindcnt are only used in user context under the rtnl, no additional
locking is necessary. Besides it was only done in some places, so kill it.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ed340102
......@@ -222,13 +222,11 @@ tcf_hash_check(u32 index, struct tc_action *a, int ovr, int bind)
{
struct tcf_st *p = NULL;
if (index && (p = tcf_hash_lookup(index)) != NULL) {
spin_lock(&p->lock);
if (bind) {
p->bindcnt++;
p->refcnt++;
}
spin_unlock(&p->lock);
a->priv = (void *) p;
a->priv = p;
}
return p;
}
......
......@@ -189,12 +189,10 @@ static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,
if (parm->index && (p = tcf_police_lookup(parm->index)) != NULL) {
a->priv = p;
spin_lock(&p->lock);
if (bind) {
p->bindcnt += 1;
p->refcnt += 1;
}
spin_unlock(&p->lock);
if (ovr)
goto override;
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment