Commit 290b1c8b authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: sched: make tcf_chain_{get,put}() static

These are no longer used outside of cls_api.c so make them static.
Move tcf_chain_flush() to avoid fwd declaration of tcf_chain_put().
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>

v1->v2:
- new patch
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53681407
...@@ -40,11 +40,8 @@ struct tcf_block_cb; ...@@ -40,11 +40,8 @@ struct tcf_block_cb;
bool tcf_queue_work(struct rcu_work *rwork, work_func_t func); bool tcf_queue_work(struct rcu_work *rwork, work_func_t func);
#ifdef CONFIG_NET_CLS #ifdef CONFIG_NET_CLS
struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index,
bool create);
struct tcf_chain *tcf_chain_get_by_act(struct tcf_block *block, struct tcf_chain *tcf_chain_get_by_act(struct tcf_block *block,
u32 chain_index); u32 chain_index);
void tcf_chain_put(struct tcf_chain *chain);
void tcf_chain_put_by_act(struct tcf_chain *chain); void tcf_chain_put_by_act(struct tcf_chain *chain);
void tcf_block_netif_keep_dst(struct tcf_block *block); void tcf_block_netif_keep_dst(struct tcf_block *block);
int tcf_block_get(struct tcf_block **p_block, int tcf_block_get(struct tcf_block **p_block,
......
...@@ -232,19 +232,6 @@ static void tcf_chain0_head_change(struct tcf_chain *chain, ...@@ -232,19 +232,6 @@ static void tcf_chain0_head_change(struct tcf_chain *chain,
tcf_chain_head_change_item(item, tp_head); tcf_chain_head_change_item(item, tp_head);
} }
static void tcf_chain_flush(struct tcf_chain *chain)
{
struct tcf_proto *tp = rtnl_dereference(chain->filter_chain);
tcf_chain0_head_change(chain, NULL);
while (tp) {
RCU_INIT_POINTER(chain->filter_chain, tp->next);
tcf_proto_destroy(tp, NULL);
tp = rtnl_dereference(chain->filter_chain);
tcf_chain_put(chain);
}
}
static void tcf_chain_destroy(struct tcf_chain *chain) static void tcf_chain_destroy(struct tcf_chain *chain)
{ {
struct tcf_block *block = chain->block; struct tcf_block *block = chain->block;
...@@ -316,12 +303,11 @@ static struct tcf_chain *__tcf_chain_get(struct tcf_block *block, ...@@ -316,12 +303,11 @@ static struct tcf_chain *__tcf_chain_get(struct tcf_block *block,
return chain; return chain;
} }
struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index, static struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index,
bool create) bool create)
{ {
return __tcf_chain_get(block, chain_index, create, false); return __tcf_chain_get(block, chain_index, create, false);
} }
EXPORT_SYMBOL(tcf_chain_get);
struct tcf_chain *tcf_chain_get_by_act(struct tcf_block *block, u32 chain_index) struct tcf_chain *tcf_chain_get_by_act(struct tcf_block *block, u32 chain_index)
{ {
...@@ -347,11 +333,10 @@ static void __tcf_chain_put(struct tcf_chain *chain, bool by_act) ...@@ -347,11 +333,10 @@ static void __tcf_chain_put(struct tcf_chain *chain, bool by_act)
} }
} }
void tcf_chain_put(struct tcf_chain *chain) static void tcf_chain_put(struct tcf_chain *chain)
{ {
__tcf_chain_put(chain, false); __tcf_chain_put(chain, false);
} }
EXPORT_SYMBOL(tcf_chain_put);
void tcf_chain_put_by_act(struct tcf_chain *chain) void tcf_chain_put_by_act(struct tcf_chain *chain)
{ {
...@@ -365,6 +350,19 @@ static void tcf_chain_put_explicitly_created(struct tcf_chain *chain) ...@@ -365,6 +350,19 @@ static void tcf_chain_put_explicitly_created(struct tcf_chain *chain)
tcf_chain_put(chain); tcf_chain_put(chain);
} }
static void tcf_chain_flush(struct tcf_chain *chain)
{
struct tcf_proto *tp = rtnl_dereference(chain->filter_chain);
tcf_chain0_head_change(chain, NULL);
while (tp) {
RCU_INIT_POINTER(chain->filter_chain, tp->next);
tcf_proto_destroy(tp, NULL);
tp = rtnl_dereference(chain->filter_chain);
tcf_chain_put(chain);
}
}
static bool tcf_block_offload_in_use(struct tcf_block *block) static bool tcf_block_offload_in_use(struct tcf_block *block)
{ {
return block->offloadcnt; return block->offloadcnt;
......
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