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()
1055 struct xa_node *node; in xas_split()
1059 node = xas->xa_node; in xas_split()
1068 struct xa_node *child = xas->xa_alloc; in xas_split()
1117 struct xa_node *node = xas->xa_node; in xas_pause()
1122 xas->xa_node = XAS_RESTART; in xas_pause()
1131 xas->xa_node = XAS_BOUNDS; in xas_pause()
1149 if (!xas_frozen(xas->xa_node)) in __xas_prev()
1151 if (!xas->xa_node) in __xas_prev()
1153 if (xas_not_node(xas->xa_node)) in __xas_prev()
1156 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_prev()
1160 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1161 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_prev()
1162 if (!xas->xa_node) in __xas_prev()
1167 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_prev()
1171 xas->xa_node = xa_to_node(entry); in __xas_prev()
1188 if (!xas_frozen(xas->xa_node)) in __xas_next()
1190 if (!xas->xa_node) in __xas_next()
1192 if (xas_not_node(xas->xa_node)) in __xas_next()
1195 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_next()
1199 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1200 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_next()
1201 if (!xas->xa_node) in __xas_next()
1206 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_next()
1210 xas->xa_node = xa_to_node(entry); in __xas_next()
1236 if (xas_error(xas) || xas->xa_node == XAS_BOUNDS) in xas_find()
1241 if (!xas->xa_node) { in xas_find()
1244 } else if (xas->xa_node == XAS_RESTART) { in xas_find()
1246 if (entry || xas_not_node(xas->xa_node)) in xas_find()
1248 } else if (!xas->xa_node->shift && in xas_find()
1255 while (xas->xa_node && (xas->xa_index <= max)) { in xas_find()
1257 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1258 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find()
1262 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find()
1264 xas->xa_node = xa_to_node(entry); in xas_find()
1274 if (!xas->xa_node) in xas_find()
1275 xas->xa_node = XAS_BOUNDS; in xas_find()
1312 if (!xas->xa_node) { in xas_find_marked()
1315 } else if (xas_top(xas->xa_node)) { in xas_find_marked()
1318 xas->xa_node = NULL; in xas_find_marked()
1327 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1328 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1333 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1334 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find_marked()
1335 if (!xas->xa_node) in xas_find_marked()
1342 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1361 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1366 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1375 xas->xa_node = XAS_RESTART; in xas_find_marked()
1396 if (!xas->xa_node) in xas_find_conflict()
1399 if (xas_top(xas->xa_node)) { in xas_find_conflict()
1404 struct xa_node *node = xa_to_node(curr); in xas_find_conflict()
1411 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1415 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1419 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1420 xas->xa_node = xa_parent_locked(xas->xa, xas->xa_node); in xas_find_conflict()
1421 if (!xas->xa_node) in xas_find_conflict()
1425 curr = xa_entry_locked(xas->xa, xas->xa_node, ++xas->xa_offset); in xas_find_conflict()
1429 xas->xa_node = xa_to_node(curr); in xas_find_conflict()
1431 curr = xa_entry_locked(xas->xa, xas->xa_node, 0); in xas_find_conflict()
1471 curr = xas->xa_node; in xas_result()
1766 if (!xas.xa_node) in xa_get_order()
1774 if (!xa_is_sibling(xas.xa_node->slots[slot])) in xa_get_order()
1779 order += xas.xa_node->shift; in xa_get_order()
1821 if (xas.xa_node == XAS_RESTART) in __xa_alloc()
2029 struct xa_node *node = xas->xa_node; in xas_sibling()
2174 void xa_delete_node(struct xa_node *node, xa_update_node_t update) in xa_delete_node()
2182 .xa_node = xa_parent_locked(node->array, node), in xa_delete_node()
2206 xas.xa_node = NULL; in xa_destroy()
2221 void xa_dump_node(const struct xa_node *node) in xa_dump_node()
2265 struct xa_node *node = xa_to_node(entry); in xa_dump_entry()