Lines Matching refs:idr

66 static struct idr_layer *get_from_free_list(struct idr *idp)  in get_from_free_list()
94 static struct idr_layer *idr_layer_alloc(gfp_t gfp_mask, struct idr *layer_idr) in idr_layer_alloc()
145 static inline void free_layer(struct idr *idr, struct idr_layer *p) in free_layer() argument
147 if (idr->hint == p) in free_layer()
148 RCU_INIT_POINTER(idr->hint, NULL); in free_layer()
153 static void __move_to_free_list(struct idr *idp, struct idr_layer *p) in __move_to_free_list()
160 static void move_to_free_list(struct idr *idp, struct idr_layer *p) in move_to_free_list()
192 static int __idr_pre_get(struct idr *idp, gfp_t gfp_mask) in __idr_pre_get()
220 static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa, in sub_alloc()
221 gfp_t gfp_mask, struct idr *layer_idr) in sub_alloc()
289 static int idr_get_empty_slot(struct idr *idp, int starting_id, in idr_get_empty_slot()
291 struct idr *layer_idr) in idr_get_empty_slot()
358 static void idr_fill_slot(struct idr *idr, void *ptr, int id, in idr_fill_slot() argument
362 rcu_assign_pointer(idr->hint, pa[0]); in idr_fill_slot()
450 int idr_alloc(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask) in idr_alloc() argument
465 id = idr_get_empty_slot(idr, start, pa, gfp_mask, NULL); in idr_alloc()
471 idr_fill_slot(idr, ptr, id, pa); in idr_alloc()
488 int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, in idr_alloc_cyclic() argument
493 id = idr_alloc(idr, ptr, max(start, idr->cur), end, gfp_mask); in idr_alloc_cyclic()
495 id = idr_alloc(idr, ptr, start, end, gfp_mask); in idr_alloc_cyclic()
498 idr->cur = id + 1; in idr_alloc_cyclic()
508 static void sub_remove(struct idr *idp, int shift, int id) in sub_remove()
550 void idr_remove(struct idr *idp, int id) in idr_remove()
583 static void __idr_remove_all(struct idr *idp) in __idr_remove_all()
631 void idr_destroy(struct idr *idp) in idr_destroy()
642 void *idr_find_slowpath(struct idr *idp, int id) in idr_find_slowpath()
686 int idr_for_each(struct idr *idp, in idr_for_each()
736 void *idr_get_next(struct idr *idp, int *nextidp) in idr_get_next()
793 void *idr_replace(struct idr *idp, void *ptr, int id) in idr_replace()
838 void idr_init(struct idr *idp) in idr_init()
840 memset(idp, 0, sizeof(struct idr)); in idr_init()
850 bool idr_is_empty(struct idr *idp) in idr_is_empty()
873 spin_lock_irqsave(&ida->idr.lock, flags); in free_bitmap()
878 spin_unlock_irqrestore(&ida->idr.lock, flags); in free_bitmap()
899 if (!__idr_pre_get(&ida->idr, gfp_mask)) in ida_pre_get()
943 t = idr_get_empty_slot(&ida->idr, idr_id, pa, 0, &ida->idr); in ida_get_new_above()
957 spin_lock_irqsave(&ida->idr.lock, flags); in ida_get_new_above()
960 spin_unlock_irqrestore(&ida->idr.lock, flags); in ida_get_new_above()
995 if (ida->idr.id_free_cnt || ida->free_bitmap) { in ida_get_new_above()
996 struct idr_layer *p = get_from_free_list(&ida->idr); in ida_get_new_above()
1012 struct idr_layer *p = ida->idr.top; in ida_remove()
1013 int shift = (ida->idr.layers - 1) * IDR_BITS; in ida_remove()
1019 if (idr_id > idr_max(ida->idr.layers)) in ida_remove()
1044 idr_remove(&ida->idr, idr_id); in ida_remove()
1061 idr_destroy(&ida->idr); in ida_destroy()
1144 idr_init(&ida->idr); in ida_init()