Lines Matching refs:bitmap

177 	__set_bit(id & IDR_MASK, p->bitmap);  in idr_mark_full()
184 while (bitmap_full(p->bitmap, IDR_SIZE)) { in idr_mark_full()
188 __set_bit((id & IDR_MASK), p->bitmap); in idr_mark_full()
237 m = find_next_zero_bit(p->bitmap, IDR_SIZE, n); in sub_alloc()
332 bitmap_clear(new->bitmap, 0, IDR_SIZE); in idr_get_empty_slot()
342 if (bitmap_full(p->bitmap, IDR_SIZE)) in idr_get_empty_slot()
343 __set_bit(0, new->bitmap); in idr_get_empty_slot()
521 __clear_bit(n, p->bitmap); in sub_remove()
527 if (likely(p != NULL && test_bit(n, p->bitmap))) { in sub_remove()
528 __clear_bit(n, p->bitmap); in sub_remove()
577 bitmap_clear(to_free->bitmap, 0, IDR_SIZE); in idr_remove()
815 if (unlikely(p == NULL || !test_bit(n, p->bitmap))) in idr_replace()
868 static void free_bitmap(struct ida *ida, struct ida_bitmap *bitmap) in free_bitmap() argument
875 ida->free_bitmap = bitmap; in free_bitmap()
876 bitmap = NULL; in free_bitmap()
881 kfree(bitmap); in free_bitmap()
904 struct ida_bitmap *bitmap; in ida_pre_get() local
906 bitmap = kmalloc(sizeof(struct ida_bitmap), gfp_mask); in ida_pre_get()
907 if (!bitmap) in ida_pre_get()
910 free_bitmap(ida, bitmap); in ida_pre_get()
935 struct ida_bitmap *bitmap; in ida_get_new_above() local
955 bitmap = (void *)pa[0]->ary[idr_id & IDR_MASK]; in ida_get_new_above()
956 if (!bitmap) { in ida_get_new_above()
958 bitmap = ida->free_bitmap; in ida_get_new_above()
962 if (!bitmap) in ida_get_new_above()
965 memset(bitmap, 0, sizeof(struct ida_bitmap)); in ida_get_new_above()
967 (void *)bitmap); in ida_get_new_above()
972 t = find_next_zero_bit(bitmap->bitmap, IDA_BITMAP_BITS, offset); in ida_get_new_above()
984 __set_bit(t, bitmap->bitmap); in ida_get_new_above()
985 if (++bitmap->nr_busy == IDA_BITMAP_BITS) in ida_get_new_above()
1017 struct ida_bitmap *bitmap; in ida_remove() local
1025 __clear_bit(n, p->bitmap); in ida_remove()
1034 __clear_bit(n, p->bitmap); in ida_remove()
1036 bitmap = (void *)p->ary[n]; in ida_remove()
1037 if (!bitmap || !test_bit(offset, bitmap->bitmap)) in ida_remove()
1041 __clear_bit(offset, bitmap->bitmap); in ida_remove()
1042 if (--bitmap->nr_busy == 0) { in ida_remove()
1043 __set_bit(n, p->bitmap); /* to please idr_remove() */ in ida_remove()
1045 free_bitmap(ida, bitmap); in ida_remove()