File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
75
75
xa = container_of (rcu , struct xdp_mem_allocator , rcu );
76
76
77
77
/* Allow this ID to be reused */
78
- ida_simple_remove (& mem_id_pool , xa -> mem .id );
78
+ ida_free (& mem_id_pool , xa -> mem .id );
79
79
80
80
kfree (xa );
81
81
}
@@ -242,7 +242,7 @@ static int __mem_id_cyclic_get(gfp_t gfp)
242
242
int id ;
243
243
244
244
again :
245
- id = ida_simple_get (& mem_id_pool , mem_id_next , MEM_ID_MAX , gfp );
245
+ id = ida_alloc_range (& mem_id_pool , mem_id_next , MEM_ID_MAX - 1 , gfp );
246
246
if (id < 0 ) {
247
247
if (id == - ENOSPC ) {
248
248
/* Cyclic allocator, reset next id */
@@ -317,7 +317,7 @@ static struct xdp_mem_allocator *__xdp_reg_mem_model(struct xdp_mem_info *mem,
317
317
/* Insert allocator into ID lookup table */
318
318
ptr = rhashtable_insert_slow (mem_id_ht , & id , & xdp_alloc -> node );
319
319
if (IS_ERR (ptr )) {
320
- ida_simple_remove (& mem_id_pool , mem -> id );
320
+ ida_free (& mem_id_pool , mem -> id );
321
321
mem -> id = 0 ;
322
322
errno = PTR_ERR (ptr );
323
323
goto err ;
You can’t perform that action at this time.
0 commit comments