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()
725 xas->xa_node = xa_parent_locked(xas->xa, node); in xas_create_range()
739 if (xas->xa_node) in xas_create_range()
744 static void update_node(struct xa_state *xas, struct xa_node *node, in update_node()
774 struct xa_node *node; in xas_store()
791 node = xas->xa_node; in xas_store()
858 if (!xas->xa_node) in xas_get_mark()
860 return node_get_mark(xas->xa_node, xas->xa_offset, mark); in xas_get_mark()
875 struct xa_node *node = xas->xa_node; in xas_set_mark()
904 struct xa_node *node = xas->xa_node; in xas_clear_mark()
953 static unsigned int node_get_marks(struct xa_node *node, unsigned int offset) in node_get_marks()
969 static void node_set_marks(struct xa_node *node, unsigned int offset, in node_set_marks()
970 struct xa_node *child, unsigned int marks) in node_set_marks()
1015 struct xa_node *node; in xas_split_alloc()
1054 struct xa_node *node; in xas_split()
1058 node = xas->xa_node; in xas_split()
1067 struct xa_node *child = xas->xa_alloc; in xas_split()
1116 struct xa_node *node = xas->xa_node; in xas_pause()
1121 xas->xa_node = XAS_RESTART; in xas_pause()
1130 xas->xa_node = XAS_BOUNDS; in xas_pause()
1148 if (!xas_frozen(xas->xa_node)) in __xas_prev()
1150 if (!xas->xa_node) in __xas_prev()
1152 if (xas_not_node(xas->xa_node)) in __xas_prev()
1155 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_prev()
1159 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1160 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_prev()
1161 if (!xas->xa_node) in __xas_prev()
1166 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_prev()
1170 xas->xa_node = xa_to_node(entry); in __xas_prev()
1187 if (!xas_frozen(xas->xa_node)) in __xas_next()
1189 if (!xas->xa_node) in __xas_next()
1191 if (xas_not_node(xas->xa_node)) in __xas_next()
1194 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_next()
1198 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1199 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_next()
1200 if (!xas->xa_node) in __xas_next()
1205 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_next()
1209 xas->xa_node = xa_to_node(entry); in __xas_next()
1235 if (xas_error(xas) || xas->xa_node == XAS_BOUNDS) in xas_find()
1240 if (!xas->xa_node) { in xas_find()
1243 } else if (xas->xa_node == XAS_RESTART) { in xas_find()
1245 if (entry || xas_not_node(xas->xa_node)) in xas_find()
1247 } else if (!xas->xa_node->shift && in xas_find()
1254 while (xas->xa_node && (xas->xa_index <= max)) { in xas_find()
1256 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1257 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find()
1261 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find()
1263 xas->xa_node = xa_to_node(entry); in xas_find()
1273 if (!xas->xa_node) in xas_find()
1274 xas->xa_node = XAS_BOUNDS; in xas_find()
1311 if (!xas->xa_node) { in xas_find_marked()
1314 } else if (xas_top(xas->xa_node)) { in xas_find_marked()
1317 xas->xa_node = NULL; in xas_find_marked()
1326 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1327 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1332 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1333 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find_marked()
1334 if (!xas->xa_node) in xas_find_marked()
1341 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1360 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1365 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1374 xas->xa_node = XAS_RESTART; in xas_find_marked()
1395 if (!xas->xa_node) in xas_find_conflict()
1398 if (xas_top(xas->xa_node)) { in xas_find_conflict()
1403 struct xa_node *node = xa_to_node(curr); in xas_find_conflict()
1410 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1414 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1418 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1419 xas->xa_node = xa_parent_locked(xas->xa, xas->xa_node); in xas_find_conflict()
1420 if (!xas->xa_node) in xas_find_conflict()
1424 curr = xa_entry_locked(xas->xa, xas->xa_node, ++xas->xa_offset); in xas_find_conflict()
1428 xas->xa_node = xa_to_node(curr); in xas_find_conflict()
1430 curr = xa_entry_locked(xas->xa, xas->xa_node, 0); in xas_find_conflict()
1470 curr = xas->xa_node; in xas_result()
1765 if (!xas.xa_node) in xa_get_order()
1773 if (!xa_is_sibling(xas.xa_node->slots[slot])) in xa_get_order()
1778 order += xas.xa_node->shift; in xa_get_order()
1820 if (xas.xa_node == XAS_RESTART) in __xa_alloc()
2028 struct xa_node *node = xas->xa_node; in xas_sibling()
2173 void xa_delete_node(struct xa_node *node, xa_update_node_t update) in xa_delete_node()
2181 .xa_node = xa_parent_locked(node->array, node), in xa_delete_node()
2205 xas.xa_node = NULL; in xa_destroy()
2220 void xa_dump_node(const struct xa_node *node) in xa_dump_node()
2264 struct xa_node *node = xa_to_node(entry); in xa_dump_entry()