Skip to content

Commit 9c16094

Browse files
author
Matthew Wilcox
committed
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>
1 parent 6e6d301 commit 9c16094

7 files changed

Lines changed: 14 additions & 19 deletions

File tree

‎include/linux/idr.h‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,11 @@ void *idr_replace(struct idr *, void *, int id);
140140
void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id);
141141
void idr_destroy(struct idr *);
142142

143-
static inline void *idr_remove_ext(struct idr *idr, unsigned long id)
143+
static inline void *idr_remove(struct idr *idr, unsigned long id)
144144
{
145145
return radix_tree_delete_item(&idr->idr_rt, id, NULL);
146146
}
147147

148-
static inline void *idr_remove(struct idr *idr, int id)
149-
{
150-
return idr_remove_ext(idr, id);
151-
}
152-
153148
static inline void idr_init(struct idr *idr)
154149
{
155150
INIT_RADIX_TREE(&idr->idr_rt, IDR_RT_MARKER);

‎net/sched/act_api.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void free_tcf(struct tc_action *p)
7878
static void tcf_idr_remove(struct tcf_idrinfo *idrinfo, struct tc_action *p)
7979
{
8080
spin_lock_bh(&idrinfo->lock);
81-
idr_remove_ext(&idrinfo->action_idr, p->tcfa_index);
81+
idr_remove(&idrinfo->action_idr, p->tcfa_index);
8282
spin_unlock_bh(&idrinfo->lock);
8383
gen_kill_estimator(&p->tcfa_rate_est);
8484
free_tcf(p);

‎net/sched/cls_api.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static void tcf_block_remove(struct tcf_block *block, struct net *net)
393393
{
394394
struct tcf_net *tn = net_generic(net, tcf_net_id);
395395

396-
idr_remove_ext(&tn->idr, block->index);
396+
idr_remove(&tn->idr, block->index);
397397
}
398398

399399
static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,

‎net/sched/cls_basic.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void basic_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
120120
list_for_each_entry_safe(f, n, &head->flist, link) {
121121
list_del_rcu(&f->link);
122122
tcf_unbind_filter(tp, &f->res);
123-
idr_remove_ext(&head->handle_idr, f->handle);
123+
idr_remove(&head->handle_idr, f->handle);
124124
if (tcf_exts_get_net(&f->exts))
125125
call_rcu(&f->rcu, basic_delete_filter);
126126
else
@@ -138,7 +138,7 @@ static int basic_delete(struct tcf_proto *tp, void *arg, bool *last,
138138

139139
list_del_rcu(&f->link);
140140
tcf_unbind_filter(tp, &f->res);
141-
idr_remove_ext(&head->handle_idr, f->handle);
141+
idr_remove(&head->handle_idr, f->handle);
142142
tcf_exts_get_net(&f->exts);
143143
call_rcu(&f->rcu, basic_delete_filter);
144144
*last = list_empty(&head->flist);
@@ -228,7 +228,7 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
228228
extack);
229229
if (err < 0) {
230230
if (!fold)
231-
idr_remove_ext(&head->handle_idr, fnew->handle);
231+
idr_remove(&head->handle_idr, fnew->handle);
232232
goto errout;
233233
}
234234

‎net/sched/cls_bpf.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog,
295295
{
296296
struct cls_bpf_head *head = rtnl_dereference(tp->root);
297297

298-
idr_remove_ext(&head->handle_idr, prog->handle);
298+
idr_remove(&head->handle_idr, prog->handle);
299299
cls_bpf_stop_offload(tp, prog, extack);
300300
list_del_rcu(&prog->link);
301301
tcf_unbind_filter(tp, &prog->res);
@@ -542,7 +542,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb,
542542
cls_bpf_free_parms(prog);
543543
errout_idr:
544544
if (!oldprog)
545-
idr_remove_ext(&head->handle_idr, prog->handle);
545+
idr_remove(&head->handle_idr, prog->handle);
546546
errout:
547547
tcf_exts_destroy(&prog->exts);
548548
kfree(prog);

‎net/sched/cls_flower.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
288288
{
289289
struct cls_fl_head *head = rtnl_dereference(tp->root);
290290

291-
idr_remove_ext(&head->handle_idr, f->handle);
291+
idr_remove(&head->handle_idr, f->handle);
292292
list_del_rcu(&f->list);
293293
if (!tc_skip_hw(f->flags))
294294
fl_hw_destroy_filter(tp, f, extack);
@@ -981,7 +981,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
981981

982982
errout_idr:
983983
if (fnew->handle)
984-
idr_remove_ext(&head->handle_idr, fnew->handle);
984+
idr_remove(&head->handle_idr, fnew->handle);
985985
errout:
986986
tcf_exts_destroy(&fnew->exts);
987987
kfree(fnew);

‎net/sched/cls_u32.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
596596
rtnl_dereference(n->next));
597597
tcf_unbind_filter(tp, &n->res);
598598
u32_remove_hw_knode(tp, n, extack);
599-
idr_remove_ext(&ht->handle_idr, n->handle);
599+
idr_remove(&ht->handle_idr, n->handle);
600600
if (tcf_exts_get_net(&n->exts))
601601
call_rcu(&n->rcu, u32_delete_key_freepf_rcu);
602602
else
@@ -623,7 +623,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
623623
if (phn == ht) {
624624
u32_clear_hw_hnode(tp, ht, extack);
625625
idr_destroy(&ht->handle_idr);
626-
idr_remove_ext(&tp_c->handle_idr, ht->handle);
626+
idr_remove(&tp_c->handle_idr, ht->handle);
627627
RCU_INIT_POINTER(*hn, ht->next);
628628
kfree_rcu(ht, rcu);
629629
return 0;
@@ -1026,7 +1026,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
10261026

10271027
err = u32_replace_hw_hnode(tp, ht, flags, extack);
10281028
if (err) {
1029-
idr_remove_ext(&tp_c->handle_idr, handle);
1029+
idr_remove(&tp_c->handle_idr, handle);
10301030
kfree(ht);
10311031
return err;
10321032
}
@@ -1162,7 +1162,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
11621162
#endif
11631163
kfree(n);
11641164
erridr:
1165-
idr_remove_ext(&ht->handle_idr, handle);
1165+
idr_remove(&ht->handle_idr, handle);
11661166
return err;
11671167
}
11681168

0 commit comments

Comments
 (0)