Lines Matching refs:n

223 	int n, m, sh;  in sub_alloc()  local
236 n = (id >> (IDR_BITS*l)) & IDR_MASK; in sub_alloc()
237 m = find_next_zero_bit(p->bitmap, IDR_SIZE, n); in sub_alloc()
261 if (m != n) { in sub_alloc()
263 id = ((id >> sh) ^ n ^ m) << sh; in sub_alloc()
514 int n; in sub_remove() local
520 n = (id >> shift) & IDR_MASK; in sub_remove()
521 __clear_bit(n, p->bitmap); in sub_remove()
522 *++paa = &p->ary[n]; in sub_remove()
523 p = p->ary[n]; in sub_remove()
526 n = id & IDR_MASK; 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()
529 RCU_INIT_POINTER(p->ary[n], NULL); in sub_remove()
585 int n, id, max; in __idr_remove_all() local
591 n = idp->layers * IDR_BITS; in __idr_remove_all()
599 while (n > IDR_BITS && p) { in __idr_remove_all()
600 n -= IDR_BITS; in __idr_remove_all()
601 p = p->ary[(id >> n) & IDR_MASK]; in __idr_remove_all()
606 id += 1 << n; in __idr_remove_all()
608 while (n < fls(id ^ bt_mask)) { in __idr_remove_all()
611 n += IDR_BITS; in __idr_remove_all()
644 int n; in idr_find_slowpath() local
653 n = (p->layer+1) * IDR_BITS; in idr_find_slowpath()
657 BUG_ON(n == 0); in idr_find_slowpath()
659 while (n > 0 && p) { in idr_find_slowpath()
660 n -= IDR_BITS; in idr_find_slowpath()
661 BUG_ON(n != p->layer*IDR_BITS); in idr_find_slowpath()
662 p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]); in idr_find_slowpath()
689 int n, id, max, error = 0; in idr_for_each() local
694 n = idp->layers * IDR_BITS; in idr_for_each()
701 while (n > 0 && p) { in idr_for_each()
702 n -= IDR_BITS; in idr_for_each()
703 p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]); in idr_for_each()
713 id += 1 << n; in idr_for_each()
714 while (n < fls(id)) { in idr_for_each()
715 n += IDR_BITS; in idr_for_each()
741 int n, max; in idr_get_next() local
747 n = (p->layer + 1) * IDR_BITS; in idr_get_next()
752 while (n > 0 && p) { in idr_get_next()
753 n -= IDR_BITS; in idr_get_next()
754 p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]); in idr_get_next()
770 id = round_up(id + 1, 1 << n); in idr_get_next()
771 while (n < fls(id)) { in idr_get_next()
772 n += IDR_BITS; in idr_get_next()
795 int n; in idr_replace() local
808 n = p->layer * IDR_BITS; in idr_replace()
809 while ((n > 0) && p) { in idr_replace()
810 p = p->ary[(id >> n) & IDR_MASK]; in idr_replace()
811 n -= IDR_BITS; in idr_replace()
814 n = id & IDR_MASK; in idr_replace()
815 if (unlikely(p == NULL || !test_bit(n, p->bitmap))) in idr_replace()
818 old_p = p->ary[n]; in idr_replace()
819 rcu_assign_pointer(p->ary[n], ptr); in idr_replace()
1016 int n; in ida_remove() local
1024 n = (idr_id >> shift) & IDR_MASK; in ida_remove()
1025 __clear_bit(n, p->bitmap); in ida_remove()
1026 p = p->ary[n]; in ida_remove()
1033 n = idr_id & IDR_MASK; in ida_remove()
1034 __clear_bit(n, p->bitmap); in ida_remove()
1036 bitmap = (void *)p->ary[n]; in ida_remove()
1043 __set_bit(n, p->bitmap); /* to please idr_remove() */ in ida_remove()