idr: Delete idr_remove_ext function
Simply changing idr_remove's 'id' argument to 'unsigned long' suffices for all callers. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
This commit is contained in:
parent
6e6d301490
commit
9c16094140
@ -140,16 +140,11 @@ void *idr_replace(struct idr *, void *, int id);
|
|||||||
void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id);
|
void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id);
|
||||||
void idr_destroy(struct idr *);
|
void idr_destroy(struct idr *);
|
||||||
|
|
||||||
static inline void *idr_remove_ext(struct idr *idr, unsigned long id)
|
static inline void *idr_remove(struct idr *idr, unsigned long id)
|
||||||
{
|
{
|
||||||
return radix_tree_delete_item(&idr->idr_rt, id, NULL);
|
return radix_tree_delete_item(&idr->idr_rt, id, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void *idr_remove(struct idr *idr, int id)
|
|
||||||
{
|
|
||||||
return idr_remove_ext(idr, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void idr_init(struct idr *idr)
|
static inline void idr_init(struct idr *idr)
|
||||||
{
|
{
|
||||||
INIT_RADIX_TREE(&idr->idr_rt, IDR_RT_MARKER);
|
INIT_RADIX_TREE(&idr->idr_rt, IDR_RT_MARKER);
|
||||||
|
@ -78,7 +78,7 @@ static void free_tcf(struct tc_action *p)
|
|||||||
static void tcf_idr_remove(struct tcf_idrinfo *idrinfo, struct tc_action *p)
|
static void tcf_idr_remove(struct tcf_idrinfo *idrinfo, struct tc_action *p)
|
||||||
{
|
{
|
||||||
spin_lock_bh(&idrinfo->lock);
|
spin_lock_bh(&idrinfo->lock);
|
||||||
idr_remove_ext(&idrinfo->action_idr, p->tcfa_index);
|
idr_remove(&idrinfo->action_idr, p->tcfa_index);
|
||||||
spin_unlock_bh(&idrinfo->lock);
|
spin_unlock_bh(&idrinfo->lock);
|
||||||
gen_kill_estimator(&p->tcfa_rate_est);
|
gen_kill_estimator(&p->tcfa_rate_est);
|
||||||
free_tcf(p);
|
free_tcf(p);
|
||||||
|
@ -393,7 +393,7 @@ static void tcf_block_remove(struct tcf_block *block, struct net *net)
|
|||||||
{
|
{
|
||||||
struct tcf_net *tn = net_generic(net, tcf_net_id);
|
struct tcf_net *tn = net_generic(net, tcf_net_id);
|
||||||
|
|
||||||
idr_remove_ext(&tn->idr, block->index);
|
idr_remove(&tn->idr, block->index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,
|
static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,
|
||||||
|
@ -120,7 +120,7 @@ static void basic_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
|
|||||||
list_for_each_entry_safe(f, n, &head->flist, link) {
|
list_for_each_entry_safe(f, n, &head->flist, link) {
|
||||||
list_del_rcu(&f->link);
|
list_del_rcu(&f->link);
|
||||||
tcf_unbind_filter(tp, &f->res);
|
tcf_unbind_filter(tp, &f->res);
|
||||||
idr_remove_ext(&head->handle_idr, f->handle);
|
idr_remove(&head->handle_idr, f->handle);
|
||||||
if (tcf_exts_get_net(&f->exts))
|
if (tcf_exts_get_net(&f->exts))
|
||||||
call_rcu(&f->rcu, basic_delete_filter);
|
call_rcu(&f->rcu, basic_delete_filter);
|
||||||
else
|
else
|
||||||
@ -138,7 +138,7 @@ static int basic_delete(struct tcf_proto *tp, void *arg, bool *last,
|
|||||||
|
|
||||||
list_del_rcu(&f->link);
|
list_del_rcu(&f->link);
|
||||||
tcf_unbind_filter(tp, &f->res);
|
tcf_unbind_filter(tp, &f->res);
|
||||||
idr_remove_ext(&head->handle_idr, f->handle);
|
idr_remove(&head->handle_idr, f->handle);
|
||||||
tcf_exts_get_net(&f->exts);
|
tcf_exts_get_net(&f->exts);
|
||||||
call_rcu(&f->rcu, basic_delete_filter);
|
call_rcu(&f->rcu, basic_delete_filter);
|
||||||
*last = list_empty(&head->flist);
|
*last = list_empty(&head->flist);
|
||||||
@ -228,7 +228,7 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
|
|||||||
extack);
|
extack);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
if (!fold)
|
if (!fold)
|
||||||
idr_remove_ext(&head->handle_idr, fnew->handle);
|
idr_remove(&head->handle_idr, fnew->handle);
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog,
|
|||||||
{
|
{
|
||||||
struct cls_bpf_head *head = rtnl_dereference(tp->root);
|
struct cls_bpf_head *head = rtnl_dereference(tp->root);
|
||||||
|
|
||||||
idr_remove_ext(&head->handle_idr, prog->handle);
|
idr_remove(&head->handle_idr, prog->handle);
|
||||||
cls_bpf_stop_offload(tp, prog, extack);
|
cls_bpf_stop_offload(tp, prog, extack);
|
||||||
list_del_rcu(&prog->link);
|
list_del_rcu(&prog->link);
|
||||||
tcf_unbind_filter(tp, &prog->res);
|
tcf_unbind_filter(tp, &prog->res);
|
||||||
@ -542,7 +542,7 @@ errout_parms:
|
|||||||
cls_bpf_free_parms(prog);
|
cls_bpf_free_parms(prog);
|
||||||
errout_idr:
|
errout_idr:
|
||||||
if (!oldprog)
|
if (!oldprog)
|
||||||
idr_remove_ext(&head->handle_idr, prog->handle);
|
idr_remove(&head->handle_idr, prog->handle);
|
||||||
errout:
|
errout:
|
||||||
tcf_exts_destroy(&prog->exts);
|
tcf_exts_destroy(&prog->exts);
|
||||||
kfree(prog);
|
kfree(prog);
|
||||||
|
@ -288,7 +288,7 @@ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
|
|||||||
{
|
{
|
||||||
struct cls_fl_head *head = rtnl_dereference(tp->root);
|
struct cls_fl_head *head = rtnl_dereference(tp->root);
|
||||||
|
|
||||||
idr_remove_ext(&head->handle_idr, f->handle);
|
idr_remove(&head->handle_idr, f->handle);
|
||||||
list_del_rcu(&f->list);
|
list_del_rcu(&f->list);
|
||||||
if (!tc_skip_hw(f->flags))
|
if (!tc_skip_hw(f->flags))
|
||||||
fl_hw_destroy_filter(tp, f, extack);
|
fl_hw_destroy_filter(tp, f, extack);
|
||||||
@ -981,7 +981,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
|
|||||||
|
|
||||||
errout_idr:
|
errout_idr:
|
||||||
if (fnew->handle)
|
if (fnew->handle)
|
||||||
idr_remove_ext(&head->handle_idr, fnew->handle);
|
idr_remove(&head->handle_idr, fnew->handle);
|
||||||
errout:
|
errout:
|
||||||
tcf_exts_destroy(&fnew->exts);
|
tcf_exts_destroy(&fnew->exts);
|
||||||
kfree(fnew);
|
kfree(fnew);
|
||||||
|
@ -596,7 +596,7 @@ static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
|
|||||||
rtnl_dereference(n->next));
|
rtnl_dereference(n->next));
|
||||||
tcf_unbind_filter(tp, &n->res);
|
tcf_unbind_filter(tp, &n->res);
|
||||||
u32_remove_hw_knode(tp, n, extack);
|
u32_remove_hw_knode(tp, n, extack);
|
||||||
idr_remove_ext(&ht->handle_idr, n->handle);
|
idr_remove(&ht->handle_idr, n->handle);
|
||||||
if (tcf_exts_get_net(&n->exts))
|
if (tcf_exts_get_net(&n->exts))
|
||||||
call_rcu(&n->rcu, u32_delete_key_freepf_rcu);
|
call_rcu(&n->rcu, u32_delete_key_freepf_rcu);
|
||||||
else
|
else
|
||||||
@ -623,7 +623,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
|
|||||||
if (phn == ht) {
|
if (phn == ht) {
|
||||||
u32_clear_hw_hnode(tp, ht, extack);
|
u32_clear_hw_hnode(tp, ht, extack);
|
||||||
idr_destroy(&ht->handle_idr);
|
idr_destroy(&ht->handle_idr);
|
||||||
idr_remove_ext(&tp_c->handle_idr, ht->handle);
|
idr_remove(&tp_c->handle_idr, ht->handle);
|
||||||
RCU_INIT_POINTER(*hn, ht->next);
|
RCU_INIT_POINTER(*hn, ht->next);
|
||||||
kfree_rcu(ht, rcu);
|
kfree_rcu(ht, rcu);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1026,7 +1026,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
|
|||||||
|
|
||||||
err = u32_replace_hw_hnode(tp, ht, flags, extack);
|
err = u32_replace_hw_hnode(tp, ht, flags, extack);
|
||||||
if (err) {
|
if (err) {
|
||||||
idr_remove_ext(&tp_c->handle_idr, handle);
|
idr_remove(&tp_c->handle_idr, handle);
|
||||||
kfree(ht);
|
kfree(ht);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1162,7 +1162,7 @@ errfree:
|
|||||||
#endif
|
#endif
|
||||||
kfree(n);
|
kfree(n);
|
||||||
erridr:
|
erridr:
|
||||||
idr_remove_ext(&ht->handle_idr, handle);
|
idr_remove(&ht->handle_idr, handle);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user