Lines Matching refs:idr
21 void idr_init(struct idr *idp) in idr_init()
23 memset(idp, 0, sizeof(struct idr)); in idr_init()
33 static void __move_to_free_list(struct idr *idp, struct idr_layer *p) in __move_to_free_list()
54 static void *__get_from_free_list(struct idr *idp) in __get_from_free_list()
95 int idr_preload(struct idr *idp, gfp_t gfp_mask) in idr_preload()
127 static int __idr_grow(struct idr *idp) in __idr_grow()
159 static int __idr_get_empty_slot(struct idr *idp, struct idr_layer **stk) in __idr_get_empty_slot()
213 static __always_inline void __idr_mark_full(struct idr *idp, int id, struct idr_layer **stk, int ma… in __idr_mark_full()
248 static __always_inline int __idr_get_path(struct idr *idp, int id, struct idr_layer **stk) in __idr_get_path()
294 static __always_inline void __idr_erase_full(struct idr *idp, int id, struct idr_layer **stk, int m… in __idr_erase_full()
357 static int __idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) in __idr_get_new_above_int()
383 int idr_alloc(struct idr *idp, void *ptr, int *id) in idr_alloc()
400 void *idr_remove(struct idr *idp, int id) in idr_remove()
423 static void __idr_remove_all_with_free(struct idr *idp, bool free) in __idr_remove_all_with_free()
475 static void __idr_destroy_with_free(struct idr *idp) in __idr_destroy_with_free()
490 void idr_remove_all(struct idr *idp) in idr_remove_all()
503 void idr_destroy(struct idr *idp) in idr_destroy()
519 void *idr_find(struct idr *idp, int id) in idr_find()
558 void *idr_find_next_getid(struct idr *idp, int64_t start_id, int *nextid) in idr_find_next_getid()
654 void *idr_find_next(struct idr *idp, int start_id) in idr_find_next()
671 int idr_replace_get_old(struct idr *idp, void *ptr, int id, void **old_ptr) in idr_replace_get_old()
716 int idr_replace(struct idr *idp, void *ptr, int id) in idr_replace()
735 bool idr_empty(struct idr *idp) in idr_empty()
788 bool idr_count(struct idr *idp, int id) in idr_count()
821 idr_init(&ida_p->idr); in ida_init()
842 if (idr_preload(&ida_p->idr, gfp_mask) != 0) in ida_preload()
845 spin_lock(&ida_p->idr.lock); in ida_preload()
853 spin_unlock(&ida_p->idr.lock); in ida_preload()
859 spin_unlock(&ida_p->idr.lock); in ida_preload()
929 int64_t idr_id = __idr_get_empty_slot(&ida_p->idr, stk); in ida_alloc()
953 __idr_mark_full(&ida_p->idr, idr_id, stk, (bmp->count == IDA_FULL ? 2 : 1)); in ida_alloc()
969 if (unlikely(NULL == ida_p || NULL == ida_p->idr.top || id < 0)) in ida_count()
976 struct ida_bitmap *bmp = idr_find(&ida_p->idr, idr_id); in ida_count()
992 if (unlikely(NULL == ida_p || NULL == ida_p->idr.top || id < 0)) in ida_remove()
1002 if (0 == __idr_get_path(&ida_p->idr, idr_id, stk)) in ida_remove()
1014 __idr_erase_full(&ida_p->idr, idr_id, stk, (b_p->count > 0 ? 1 : 0)); in ida_remove()
1035 __idr_destroy_with_free(&ida_p->idr); in ida_destroy()
1036 ida_p->idr.top = NULL; in ida_destroy()
1050 if (ida_p == NULL || ida_p->idr.top == NULL || !ida_p->idr.top->bitmap) in ida_empty()