Lines Matching refs:xa_node
80 static inline unsigned long *node_marks(struct xa_node *node, xa_mark_t mark) in node_marks()
85 static inline bool node_get_mark(struct xa_node *node, in node_get_mark()
92 static inline bool node_set_mark(struct xa_node *node, unsigned int offset, in node_set_mark()
99 static inline bool node_clear_mark(struct xa_node *node, unsigned int offset, in node_clear_mark()
105 static inline bool node_any_mark(struct xa_node *node, xa_mark_t mark) in node_any_mark()
110 static inline void node_mark_all(struct xa_node *node, xa_mark_t mark) in node_mark_all()
135 unsigned long *marks = xas->xa_node->marks[mark]; in xas_squash_marks()
144 static unsigned int get_offset(unsigned long index, struct xa_node *node) in get_offset()
151 xas->xa_offset = get_offset(xas->xa_index, xas->xa_node); in xas_set_offset()
157 unsigned int shift = xas->xa_node->shift; in xas_move_index()
170 xas->xa_node = XAS_BOUNDS; in set_bounds()
199 xas->xa_node = NULL; in xas_start()
204 struct xa_node *node) in xas_descend()
209 xas->xa_node = node; in xas_descend()
241 struct xa_node *node = xa_to_node(entry); in xas_load()
255 static void xa_node_free(struct xa_node *node) in xa_node_free()
271 struct xa_node *next, *node = xas->xa_alloc; in xas_destroy()
301 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in xas_nomem()
312 xas->xa_node = XAS_RESTART; in xas_nomem()
331 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in __xas_nomem()
348 xas->xa_node = XAS_RESTART; in __xas_nomem()
352 static void xas_update(struct xa_state *xas, struct xa_node *node) in xas_update()
362 struct xa_node *parent = xas->xa_node; in xas_alloc()
363 struct xa_node *node = xas->xa_alloc; in xas_alloc()
394 RCU_INIT_POINTER(node->parent, xas->xa_node); in xas_alloc()
441 struct xa_node *node = xas->xa_node; in xas_shrink()
456 xas->xa_node = XAS_BOUNDS; in xas_shrink()
484 struct xa_node *node = xas->xa_node; in xas_delete_node()
487 struct xa_node *parent; in xas_delete_node()
494 xas->xa_node = parent; in xas_delete_node()
500 xas->xa_node = XAS_BOUNDS; in xas_delete_node()
524 static void xas_free_nodes(struct xa_state *xas, struct xa_node *top) in xas_free_nodes()
527 struct xa_node *node = top; in xas_free_nodes()
541 struct xa_node *parent; in xas_free_nodes()
563 struct xa_node *node = NULL; in xas_expand()
577 xas->xa_node = NULL; in xas_expand()
623 xas->xa_node = node; in xas_expand()
645 struct xa_node *node = xas->xa_node; in xas_create()
651 xas->xa_node = NULL; in xas_create()
712 if (xas_is_node(xas) && xas->xa_node->shift == xas->xa_shift) in xas_create_range()
726 struct xa_node *node = xas->xa_node; in xas_create_range()
729 xas->xa_node = xa_parent_locked(xas->xa, node); in xas_create_range()
743 if (xas->xa_node) in xas_create_range()
748 static void update_node(struct xa_state *xas, struct xa_node *node, in update_node()
778 struct xa_node *node; in xas_store()
795 node = xas->xa_node; in xas_store()
862 if (!xas->xa_node) in xas_get_mark()
864 return node_get_mark(xas->xa_node, xas->xa_offset, mark); in xas_get_mark()
879 struct xa_node *node = xas->xa_node; in xas_set_mark()
908 struct xa_node *node = xas->xa_node; in xas_clear_mark()
957 static unsigned int node_get_marks(struct xa_node *node, unsigned int offset) in node_get_marks()
973 static inline void node_mark_slots(struct xa_node *node, unsigned int sibs, in node_mark_slots()
986 static void node_set_marks(struct xa_node *node, unsigned int offset, in node_set_marks()
987 struct xa_node *child, unsigned int sibs, in node_set_marks()
1033 struct xa_node *node; in xas_split_alloc()
1073 struct xa_node *node; in xas_split()
1077 node = xas->xa_node; in xas_split()
1086 struct xa_node *child = xas->xa_alloc; in xas_split()
1138 struct xa_node *node = xas->xa_node; in xas_pause()
1143 xas->xa_node = XAS_RESTART; in xas_pause()
1152 xas->xa_node = XAS_BOUNDS; in xas_pause()
1170 if (!xas_frozen(xas->xa_node)) in __xas_prev()
1172 if (!xas->xa_node) in __xas_prev()
1174 if (xas_not_node(xas->xa_node)) in __xas_prev()
1177 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_prev()
1181 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1182 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_prev()
1183 if (!xas->xa_node) in __xas_prev()
1188 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_prev()
1192 xas->xa_node = xa_to_node(entry); in __xas_prev()
1209 if (!xas_frozen(xas->xa_node)) in __xas_next()
1211 if (!xas->xa_node) in __xas_next()
1213 if (xas_not_node(xas->xa_node)) in __xas_next()
1216 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_next()
1220 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1221 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_next()
1222 if (!xas->xa_node) in __xas_next()
1227 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_next()
1231 xas->xa_node = xa_to_node(entry); in __xas_next()
1257 if (xas_error(xas) || xas->xa_node == XAS_BOUNDS) in xas_find()
1262 if (!xas->xa_node) { in xas_find()
1265 } else if (xas->xa_node == XAS_RESTART) { in xas_find()
1267 if (entry || xas_not_node(xas->xa_node)) in xas_find()
1269 } else if (!xas->xa_node->shift && in xas_find()
1276 while (xas->xa_node && (xas->xa_index <= max)) { in xas_find()
1278 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1279 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find()
1283 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find()
1285 xas->xa_node = xa_to_node(entry); in xas_find()
1295 if (!xas->xa_node) in xas_find()
1296 xas->xa_node = XAS_BOUNDS; in xas_find()
1333 if (!xas->xa_node) { in xas_find_marked()
1336 } else if (xas_top(xas->xa_node)) { in xas_find_marked()
1339 xas->xa_node = NULL; in xas_find_marked()
1348 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1349 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1354 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1355 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find_marked()
1356 if (!xas->xa_node) in xas_find_marked()
1363 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1382 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1387 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1396 xas->xa_node = XAS_RESTART; in xas_find_marked()
1417 if (!xas->xa_node) in xas_find_conflict()
1420 if (xas_top(xas->xa_node)) { in xas_find_conflict()
1425 struct xa_node *node = xa_to_node(curr); in xas_find_conflict()
1432 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1436 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1440 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1441 xas->xa_node = xa_parent_locked(xas->xa, xas->xa_node); in xas_find_conflict()
1442 if (!xas->xa_node) in xas_find_conflict()
1446 curr = xa_entry_locked(xas->xa, xas->xa_node, ++xas->xa_offset); in xas_find_conflict()
1450 xas->xa_node = xa_to_node(curr); in xas_find_conflict()
1452 curr = xa_entry_locked(xas->xa, xas->xa_node, 0); in xas_find_conflict()
1492 curr = xas->xa_node; in xas_result()
1780 if (!xas->xa_node) in xas_get_order()
1788 if (!xa_is_sibling(xa_entry(xas->xa, xas->xa_node, slot))) in xas_get_order()
1793 order += xas->xa_node->shift; in xas_get_order()
1858 if (xas.xa_node == XAS_RESTART) in __xa_alloc()
2069 struct xa_node *node = xas->xa_node; in xas_sibling()
2214 void xa_delete_node(struct xa_node *node, xa_update_node_t update) in xa_delete_node()
2222 .xa_node = xa_parent_locked(node->array, node), in xa_delete_node()
2246 xas.xa_node = NULL; in xa_destroy()
2261 void xa_dump_node(const struct xa_node *node) in xa_dump_node()
2305 struct xa_node *node = xa_to_node(entry); in xa_dump_entry()