diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-01-17 14:37:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-21 17:43:16 -0500 |
commit | c779f7af99f73abb7270dcaa4c29178ab5ef7472 (patch) | |
tree | 166e92b6b61aa2259c91e96fac1683ffe2fb8c13 /net/sched/act_pedit.c | |
parent | 75e4364f67d9cb996f9a6ff982ad9b3700648591 (diff) |
net_sched: act: fetch hinfo from a->ops->hinfo
Every action ops has a pointer to hash info, so we don't need to
hard-code it in each module.
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_pedit.c')
-rw-r--r-- | net/sched/act_pedit.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 109265d7c14b..be3f0f6875bb 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
@@ -57,12 +57,11 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, | |||
57 | if (nla_len(tb[TCA_PEDIT_PARMS]) < sizeof(*parm) + ksize) | 57 | if (nla_len(tb[TCA_PEDIT_PARMS]) < sizeof(*parm) + ksize) |
58 | return -EINVAL; | 58 | return -EINVAL; |
59 | 59 | ||
60 | pc = tcf_hash_check(parm->index, a, bind, &pedit_hash_info); | 60 | pc = tcf_hash_check(parm->index, a, bind); |
61 | if (!pc) { | 61 | if (!pc) { |
62 | if (!parm->nkeys) | 62 | if (!parm->nkeys) |
63 | return -EINVAL; | 63 | return -EINVAL; |
64 | pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind, | 64 | pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind); |
65 | &pedit_hash_info); | ||
66 | if (IS_ERR(pc)) | 65 | if (IS_ERR(pc)) |
67 | return PTR_ERR(pc); | 66 | return PTR_ERR(pc); |
68 | p = to_pedit(pc); | 67 | p = to_pedit(pc); |
@@ -77,7 +76,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, | |||
77 | ret = ACT_P_CREATED; | 76 | ret = ACT_P_CREATED; |
78 | } else { | 77 | } else { |
79 | p = to_pedit(pc); | 78 | p = to_pedit(pc); |
80 | tcf_hash_release(pc, bind, &pedit_hash_info); | 79 | tcf_hash_release(pc, bind, a->ops->hinfo); |
81 | if (bind) | 80 | if (bind) |
82 | return 0; | 81 | return 0; |
83 | if (!ovr) | 82 | if (!ovr) |
@@ -101,7 +100,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, | |||
101 | memcpy(p->tcfp_keys, parm->keys, ksize); | 100 | memcpy(p->tcfp_keys, parm->keys, ksize); |
102 | spin_unlock_bh(&p->tcf_lock); | 101 | spin_unlock_bh(&p->tcf_lock); |
103 | if (ret == ACT_P_CREATED) | 102 | if (ret == ACT_P_CREATED) |
104 | tcf_hash_insert(pc, &pedit_hash_info); | 103 | tcf_hash_insert(pc, a->ops->hinfo); |
105 | return ret; | 104 | return ret; |
106 | } | 105 | } |
107 | 106 | ||