aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2018-08-19 15:22:08 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-21 15:45:44 -0400
commit7d485c451fc82f8ae431cdb379521bc6d0641064 (patch)
tree88ba0e67ca084c0318fac1fc147c45969a8a5eff
parentb144e7ec51a132eac00a68bf897b6349d810022f (diff)
net_sched: remove unused tcf_idr_check()
tcf_idr_check() is replaced by tcf_idr_check_alloc(), and __tcf_idr_check() now can be folded into tcf_idr_search(). Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Cc: Jiri Pirko <jiri@mellanox.com> Cc: Vlad Buslov <vladbu@mellanox.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/act_api.h2
-rw-r--r--net/sched/act_api.c22
2 files changed, 3 insertions, 21 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index e32708491d83..eaa0e8b93d5b 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -147,8 +147,6 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
147 const struct tc_action_ops *ops, 147 const struct tc_action_ops *ops,
148 struct netlink_ext_ack *extack); 148 struct netlink_ext_ack *extack);
149int tcf_idr_search(struct tc_action_net *tn, struct tc_action **a, u32 index); 149int tcf_idr_search(struct tc_action_net *tn, struct tc_action **a, u32 index);
150bool tcf_idr_check(struct tc_action_net *tn, u32 index, struct tc_action **a,
151 int bind);
152int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, 150int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
153 struct tc_action **a, const struct tc_action_ops *ops, 151 struct tc_action **a, const struct tc_action_ops *ops,
154 int bind, bool cpustats); 152 int bind, bool cpustats);
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index ba55226928a3..d76948f02a02 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -300,21 +300,17 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
300} 300}
301EXPORT_SYMBOL(tcf_generic_walker); 301EXPORT_SYMBOL(tcf_generic_walker);
302 302
303static bool __tcf_idr_check(struct tc_action_net *tn, u32 index, 303int tcf_idr_search(struct tc_action_net *tn, struct tc_action **a, u32 index)
304 struct tc_action **a, int bind)
305{ 304{
306 struct tcf_idrinfo *idrinfo = tn->idrinfo; 305 struct tcf_idrinfo *idrinfo = tn->idrinfo;
307 struct tc_action *p; 306 struct tc_action *p;
308 307
309 spin_lock(&idrinfo->lock); 308 spin_lock(&idrinfo->lock);
310 p = idr_find(&idrinfo->action_idr, index); 309 p = idr_find(&idrinfo->action_idr, index);
311 if (IS_ERR(p)) { 310 if (IS_ERR(p))
312 p = NULL; 311 p = NULL;
313 } else if (p) { 312 else if (p)
314 refcount_inc(&p->tcfa_refcnt); 313 refcount_inc(&p->tcfa_refcnt);
315 if (bind)
316 atomic_inc(&p->tcfa_bindcnt);
317 }
318 spin_unlock(&idrinfo->lock); 314 spin_unlock(&idrinfo->lock);
319 315
320 if (p) { 316 if (p) {
@@ -323,20 +319,8 @@ static bool __tcf_idr_check(struct tc_action_net *tn, u32 index,
323 } 319 }
324 return false; 320 return false;
325} 321}
326
327int tcf_idr_search(struct tc_action_net *tn, struct tc_action **a, u32 index)
328{
329 return __tcf_idr_check(tn, index, a, 0);
330}
331EXPORT_SYMBOL(tcf_idr_search); 322EXPORT_SYMBOL(tcf_idr_search);
332 323
333bool tcf_idr_check(struct tc_action_net *tn, u32 index, struct tc_action **a,
334 int bind)
335{
336 return __tcf_idr_check(tn, index, a, bind);
337}
338EXPORT_SYMBOL(tcf_idr_check);
339
340static int tcf_idr_delete_index(struct tcf_idrinfo *idrinfo, u32 index) 324static int tcf_idr_delete_index(struct tcf_idrinfo *idrinfo, u32 index)
341{ 325{
342 struct tc_action *p; 326 struct tc_action *p;