Lines Matching refs:xa_node
77 static inline unsigned long *node_marks(struct xa_node *node, xa_mark_t mark) in node_marks()
82 static inline bool node_get_mark(struct xa_node *node, in node_get_mark()
89 static inline bool node_set_mark(struct xa_node *node, unsigned int offset, in node_set_mark()
96 static inline bool node_clear_mark(struct xa_node *node, unsigned int offset, in node_clear_mark()
102 static inline bool node_any_mark(struct xa_node *node, xa_mark_t mark) in node_any_mark()
107 static inline void node_mark_all(struct xa_node *node, xa_mark_t mark) in node_mark_all()
132 unsigned long *marks = xas->xa_node->marks[mark]; in xas_squash_marks()
141 static unsigned int get_offset(unsigned long index, struct xa_node *node) in get_offset()
148 xas->xa_offset = get_offset(xas->xa_index, xas->xa_node); in xas_set_offset()
154 unsigned int shift = xas->xa_node->shift; in xas_move_index()
167 xas->xa_node = XAS_BOUNDS; in set_bounds()
196 xas->xa_node = NULL; in xas_start()
200 static void *xas_descend(struct xa_state *xas, struct xa_node *node) in xas_descend()
205 xas->xa_node = node; in xas_descend()
235 struct xa_node *node = xa_to_node(entry); in xas_load()
253 static void xa_node_free(struct xa_node *node) in xa_node_free()
268 struct xa_node *node = xas->xa_alloc; in xas_destroy()
297 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in xas_nomem()
307 xas->xa_node = XAS_RESTART; in xas_nomem()
326 if (xas->xa_node != XA_ERROR(-ENOMEM)) { in __xas_nomem()
342 xas->xa_node = XAS_RESTART; in __xas_nomem()
346 static void xas_update(struct xa_state *xas, struct xa_node *node) in xas_update()
356 struct xa_node *parent = xas->xa_node; in xas_alloc()
357 struct xa_node *node = xas->xa_alloc; in xas_alloc()
388 RCU_INIT_POINTER(node->parent, xas->xa_node); in xas_alloc()
435 struct xa_node *node = xas->xa_node; in xas_shrink()
450 xas->xa_node = XAS_BOUNDS; in xas_shrink()
478 struct xa_node *node = xas->xa_node; in xas_delete_node()
481 struct xa_node *parent; in xas_delete_node()
488 xas->xa_node = parent; in xas_delete_node()
494 xas->xa_node = XAS_BOUNDS; in xas_delete_node()
518 static void xas_free_nodes(struct xa_state *xas, struct xa_node *top) in xas_free_nodes()
521 struct xa_node *node = top; in xas_free_nodes()
535 struct xa_node *parent; in xas_free_nodes()
557 struct xa_node *node = NULL; in xas_expand()
571 xas->xa_node = NULL; in xas_expand()
617 xas->xa_node = node; in xas_expand()
639 struct xa_node *node = xas->xa_node; in xas_create()
645 xas->xa_node = NULL; in xas_create()
706 if (xas_is_node(xas) && xas->xa_node->shift == xas->xa_shift) in xas_create_range()
720 struct xa_node *node = xas->xa_node; in xas_create_range()
721 xas->xa_node = xa_parent_locked(xas->xa, node); in xas_create_range()
735 if (xas->xa_node) in xas_create_range()
740 static void update_node(struct xa_state *xas, struct xa_node *node, in update_node()
770 struct xa_node *node; in xas_store()
787 node = xas->xa_node; in xas_store()
854 if (!xas->xa_node) in xas_get_mark()
856 return node_get_mark(xas->xa_node, xas->xa_offset, mark); in xas_get_mark()
871 struct xa_node *node = xas->xa_node; in xas_set_mark()
900 struct xa_node *node = xas->xa_node; in xas_clear_mark()
965 struct xa_node *node = xas->xa_node; in xas_pause()
980 xas->xa_node = XAS_RESTART; in xas_pause()
995 if (!xas_frozen(xas->xa_node)) in __xas_prev()
997 if (!xas->xa_node) in __xas_prev()
999 if (xas_not_node(xas->xa_node)) in __xas_prev()
1002 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_prev()
1006 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1007 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_prev()
1008 if (!xas->xa_node) in __xas_prev()
1013 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_prev()
1017 xas->xa_node = xa_to_node(entry); in __xas_prev()
1034 if (!xas_frozen(xas->xa_node)) in __xas_next()
1036 if (!xas->xa_node) in __xas_next()
1038 if (xas_not_node(xas->xa_node)) in __xas_next()
1041 if (xas->xa_offset != get_offset(xas->xa_index, xas->xa_node)) in __xas_next()
1045 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1046 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in __xas_next()
1047 if (!xas->xa_node) in __xas_next()
1052 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in __xas_next()
1056 xas->xa_node = xa_to_node(entry); in __xas_next()
1085 if (!xas->xa_node) { in xas_find()
1088 } else if (xas_top(xas->xa_node)) { in xas_find()
1090 if (entry || xas_not_node(xas->xa_node)) in xas_find()
1092 } else if (!xas->xa_node->shift && in xas_find()
1099 while (xas->xa_node && (xas->xa_index <= max)) { in xas_find()
1101 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1102 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find()
1106 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find()
1108 xas->xa_node = xa_to_node(entry); in xas_find()
1118 if (!xas->xa_node) in xas_find()
1119 xas->xa_node = XAS_BOUNDS; in xas_find()
1154 if (!xas->xa_node) { in xas_find_marked()
1157 } else if (xas_top(xas->xa_node)) { in xas_find_marked()
1160 xas->xa_node = NULL; in xas_find_marked()
1169 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1170 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1175 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1176 xas->xa_node = xa_parent(xas->xa, xas->xa_node); in xas_find_marked()
1177 if (!xas->xa_node) in xas_find_marked()
1184 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1203 entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); in xas_find_marked()
1206 xas->xa_node = xa_to_node(entry); in xas_find_marked()
1215 xas->xa_node = XAS_RESTART; in xas_find_marked()
1236 if (!xas->xa_node) in xas_find_conflict()
1239 if (xas_top(xas->xa_node)) { in xas_find_conflict()
1244 struct xa_node *node = xa_to_node(curr); in xas_find_conflict()
1251 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1255 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1259 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1260 xas->xa_node = xa_parent_locked(xas->xa, xas->xa_node); in xas_find_conflict()
1261 if (!xas->xa_node) in xas_find_conflict()
1265 curr = xa_entry_locked(xas->xa, xas->xa_node, ++xas->xa_offset); in xas_find_conflict()
1269 xas->xa_node = xa_to_node(curr); in xas_find_conflict()
1271 curr = xa_entry_locked(xas->xa, xas->xa_node, 0); in xas_find_conflict()
1311 curr = xas->xa_node; in xas_result()
1621 if (xas.xa_node == XAS_RESTART) in __xa_alloc()
1856 if (xas.xa_node == XAS_BOUNDS) in xa_find_after()
1972 xas.xa_node = NULL; in xa_destroy()
1987 void xa_dump_node(const struct xa_node *node) in xa_dump_node()
2031 struct xa_node *node = xa_to_node(entry); in xa_dump_entry()