Lines Matching refs:xa_node

78 static inline unsigned long *node_marks(struct xa_node *node, xa_mark_t mark)  in node_marks()
83 static inline bool node_get_mark(struct xa_node *node, in node_get_mark()
90 static inline bool node_set_mark(struct xa_node *node, unsigned int offset, in node_set_mark()
97 static inline bool node_clear_mark(struct xa_node *node, unsigned int offset, in node_clear_mark()
103 static inline bool node_any_mark(struct xa_node *node, xa_mark_t mark) in node_any_mark()
108 static inline void node_mark_all(struct xa_node *node, xa_mark_t mark) in node_mark_all()
133 unsigned long *marks = xas->xa_node->marks[mark]; in xas_squash_marks()
142 static unsigned int get_offset(unsigned long index, struct xa_node *node) in get_offset()
149 xas->xa_offset = get_offset(xas->xa_index, xas->xa_node); in xas_set_offset()
155 unsigned int shift = xas->xa_node->shift; in xas_move_index()
168 xas->xa_node = XAS_BOUNDS; in set_bounds()
197 xas->xa_node = NULL; in xas_start()
201 static void *xas_descend(struct xa_state *xas, struct xa_node *node) in xas_descend()
206 xas->xa_node = node; in xas_descend()
236 struct xa_node *node = xa_to_node(entry); in xas_load()
254 static void xa_node_free(struct xa_node *node) in xa_node_free()
269 struct xa_node *next, *node = xas->xa_alloc; in xas_destroy()
299 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in xas_nomem()
310 xas->xa_node = XAS_RESTART; in xas_nomem()
329 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in __xas_nomem()
346 xas->xa_node = XAS_RESTART; in __xas_nomem()
350 static void xas_update(struct xa_state *xas, struct xa_node *node) in xas_update()
360 struct xa_node *parent = xas->xa_node; in xas_alloc()
361 struct xa_node *node = xas->xa_alloc; in xas_alloc()
392 RCU_INIT_POINTER(node->parent, xas->xa_node); in xas_alloc()
439 struct xa_node *node = xas->xa_node; in xas_shrink()
454 xas->xa_node = XAS_BOUNDS; in xas_shrink()
482 struct xa_node *node = xas->xa_node; in xas_delete_node()
485 struct xa_node *parent; in xas_delete_node()
492 xas->xa_node = parent; in xas_delete_node()
498 xas->xa_node = XAS_BOUNDS; in xas_delete_node()
522 static void xas_free_nodes(struct xa_state *xas, struct xa_node *top) in xas_free_nodes()
525 struct xa_node *node = top; in xas_free_nodes()
539 struct xa_node *parent; in xas_free_nodes()
561 struct xa_node *node = NULL; in xas_expand()
575 xas->xa_node = NULL; in xas_expand()
621 xas->xa_node = node; in xas_expand()
643 struct xa_node *node = xas->xa_node; in xas_create()
649 xas->xa_node = NULL; in xas_create()
710 if (xas_is_node(xas) && xas->xa_node->shift == xas->xa_shift) in xas_create_range()
724 struct xa_node *node = xas->xa_node; in xas_create_range()
727 xas->xa_node = xa_parent_locked(xas->xa, node); in xas_create_range()
741 if (xas->xa_node) in xas_create_range()
746 static void update_node(struct xa_state *xas, struct xa_node *node, in update_node()
776 struct xa_node *node; in xas_store()
793 node = xas->xa_node; in xas_store()
860 if (!xas->xa_node) in xas_get_mark()
862 return node_get_mark(xas->xa_node, xas->xa_offset, mark); in xas_get_mark()
877 struct xa_node *node = xas->xa_node; in xas_set_mark()
906 struct xa_node *node = xas->xa_node; in xas_clear_mark()
955 static unsigned int node_get_marks(struct xa_node *node, unsigned int offset) in node_get_marks()
971 static void node_set_marks(struct xa_node *node, unsigned int offset, in node_set_marks()
972 struct xa_node *child, unsigned int marks) in node_set_marks()
1017 struct xa_node *node; in xas_split_alloc()
1056 struct xa_node *node; in xas_split()
1060 node = xas->xa_node; in xas_split()
1069 struct xa_node *child = xas->xa_alloc; in xas_split()
1120 struct xa_node *node = xas->xa_node; in xas_pause()
1125 xas->xa_node = XAS_RESTART; in xas_pause()
1134 xas->xa_node = XAS_BOUNDS; in xas_pause()
1152 if (!xas_frozen(xas->xa_node)) in __xas_prev()
1154 if (!xas->xa_node) in __xas_prev()
1156 if (xas_not_node(xas->xa_node)) in __xas_prev()
1159 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_prev()
1163 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1164 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_prev()
1165 if (!xas->xa_node) in __xas_prev()
1170 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_prev()
1174 xas->xa_node = xa_to_node(entry); in __xas_prev()
1191 if (!xas_frozen(xas->xa_node)) in __xas_next()
1193 if (!xas->xa_node) in __xas_next()
1195 if (xas_not_node(xas->xa_node)) in __xas_next()
1198 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_next()
1202 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1203 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_next()
1204 if (!xas->xa_node) in __xas_next()
1209 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_next()
1213 xas->xa_node = xa_to_node(entry); in __xas_next()
1239 if (xas_error(xas) || xas->xa_node == XAS_BOUNDS) in xas_find()
1244 if (!xas->xa_node) { in xas_find()
1247 } else if (xas->xa_node == XAS_RESTART) { in xas_find()
1249 if (entry || xas_not_node(xas->xa_node)) in xas_find()
1251 } else if (!xas->xa_node->shift && in xas_find()
1258 while (xas->xa_node && (xas->xa_index <= max)) { in xas_find()
1260 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1261 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find()
1265 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find()
1267 xas->xa_node = xa_to_node(entry); in xas_find()
1277 if (!xas->xa_node) in xas_find()
1278 xas->xa_node = XAS_BOUNDS; in xas_find()
1315 if (!xas->xa_node) { in xas_find_marked()
1318 } else if (xas_top(xas->xa_node)) { in xas_find_marked()
1321 xas->xa_node = NULL; in xas_find_marked()
1330 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1331 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1336 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1337 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find_marked()
1338 if (!xas->xa_node) in xas_find_marked()
1345 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1364 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1369 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1378 xas->xa_node = XAS_RESTART; in xas_find_marked()
1399 if (!xas->xa_node) in xas_find_conflict()
1402 if (xas_top(xas->xa_node)) { in xas_find_conflict()
1407 struct xa_node *node = xa_to_node(curr); in xas_find_conflict()
1414 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1418 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1422 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1423 xas->xa_node = xa_parent_locked(xas->xa, xas->xa_node); in xas_find_conflict()
1424 if (!xas->xa_node) in xas_find_conflict()
1428 curr = xa_entry_locked(xas->xa, xas->xa_node, ++xas->xa_offset); in xas_find_conflict()
1432 xas->xa_node = xa_to_node(curr); in xas_find_conflict()
1434 curr = xa_entry_locked(xas->xa, xas->xa_node, 0); in xas_find_conflict()
1474 curr = xas->xa_node; in xas_result()
1769 if (!xas.xa_node) in xa_get_order()
1777 if (!xa_is_sibling(xas.xa_node->slots[slot])) in xa_get_order()
1782 order += xas.xa_node->shift; in xa_get_order()
1824 if (xas.xa_node == XAS_RESTART) in __xa_alloc()
2032 struct xa_node *node = xas->xa_node; in xas_sibling()
2177 void xa_delete_node(struct xa_node *node, xa_update_node_t update) in xa_delete_node()
2185 .xa_node = xa_parent_locked(node->array, node), in xa_delete_node()
2209 xas.xa_node = NULL; in xa_destroy()
2224 void xa_dump_node(const struct xa_node *node) in xa_dump_node()
2268 struct xa_node *node = xa_to_node(entry); in xa_dump_entry()