Lines Matching refs:cand

50 static void toptree_remove(struct toptree *cand)  in toptree_remove()  argument
54 list_del_init(&cand->sibling); in toptree_remove()
55 oldparent = cand->parent; in toptree_remove()
56 cand->parent = NULL; in toptree_remove()
68 void toptree_free(struct toptree *cand) in toptree_free() argument
72 if (cand->parent) in toptree_free()
73 toptree_remove(cand); in toptree_free()
74 toptree_for_each_child_safe(child, tmp, cand) in toptree_free()
76 kfree(cand); in toptree_free()
91 void toptree_update_mask(struct toptree *cand) in toptree_update_mask() argument
95 cpumask_clear(&cand->mask); in toptree_update_mask()
96 list_for_each_entry(child, &cand->children, sibling) in toptree_update_mask()
97 cpumask_or(&cand->mask, &cand->mask, &child->mask); in toptree_update_mask()
98 if (cand->parent) in toptree_update_mask()
99 toptree_update_mask(cand->parent); in toptree_update_mask()
113 static int toptree_insert(struct toptree *cand, struct toptree *target) in toptree_insert() argument
115 if (!cand || !target) in toptree_insert()
117 if (target->level != (cand->level + 1)) in toptree_insert()
119 list_add_tail(&cand->sibling, &target->children); in toptree_insert()
120 cand->parent = target; in toptree_insert()
132 static void toptree_move_children(struct toptree *cand, struct toptree *target) in toptree_move_children() argument
136 toptree_for_each_child_safe(child, tmp, cand) in toptree_move_children()
148 void toptree_unify(struct toptree *cand) in toptree_unify() argument
153 if (cand->level < 2) in toptree_unify()
156 cand_copy = toptree_alloc(cand->level, 0); in toptree_unify()
157 toptree_for_each_child_safe(child, tmp, cand) { in toptree_unify()
166 toptree_move_children(cand_copy, cand); in toptree_unify()
169 toptree_for_each_child(child, cand) in toptree_unify()
189 void toptree_move(struct toptree *cand, struct toptree *target) in toptree_move() argument
193 if (cand->level + 1 == target->level) { in toptree_move()
194 toptree_remove(cand); in toptree_move()
195 toptree_insert(cand, target); in toptree_move()
200 ptr = cand; in toptree_move()
213 toptree_remove(cand); in toptree_move()
214 toptree_insert(cand, real_insert_point); in toptree_move()
227 struct toptree *toptree_get_child(struct toptree *cand, int id) in toptree_get_child() argument
231 toptree_for_each_child(child, cand) in toptree_get_child()
234 child = toptree_alloc(cand->level-1, id); in toptree_get_child()
235 toptree_insert(child, cand); in toptree_get_child()