diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2018-07-05 17:24:24 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-08 06:42:28 +0300 |
commit | 036bb44327f50273e85ee4a2c9b56eebce1c0838 (patch) | |
tree | 7760e998967d7a32ba06550c2c169abab9cc0b19 /net/sched/act_skbmod.c | |
parent | eec94fdb04806790c7b7e6ea347820064cc6d467 (diff) | |
download | linux-036bb44327f50273e85ee4a2c9b56eebce1c0838.tar.xz |
net: sched: change type of reference and bind counters
Change type of action reference counter to refcount_t.
Change type of action bind counter to atomic_t.
This type is used to allow decrementing bind counter without testing
for 0 result.
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_skbmod.c')
-rw-r--r-- | net/sched/act_skbmod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index ad050d7d4b46..ff90d720eda3 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c @@ -205,8 +205,8 @@ static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a, struct tcf_skbmod_params *p = rtnl_dereference(d->skbmod_p); struct tc_skbmod opt = { .index = d->tcf_index, - .refcnt = d->tcf_refcnt - ref, - .bindcnt = d->tcf_bindcnt - bind, + .refcnt = refcount_read(&d->tcf_refcnt) - ref, + .bindcnt = atomic_read(&d->tcf_bindcnt) - bind, .action = d->tcf_action, }; struct tcf_t t; |