Lines Matching refs:offset
86 unsigned int offset, xa_mark_t mark) in node_get_mark() argument
88 return test_bit(offset, node_marks(node, mark)); in node_get_mark()
92 static inline bool node_set_mark(struct xa_node *node, unsigned int offset, in node_set_mark() argument
95 return __test_and_set_bit(offset, node_marks(node, mark)); in node_set_mark()
99 static inline bool node_clear_mark(struct xa_node *node, unsigned int offset, in node_clear_mark() argument
102 return __test_and_clear_bit(offset, node_marks(node, mark)); in node_clear_mark()
155 static void xas_move_index(struct xa_state *xas, unsigned long offset) in xas_move_index() argument
159 xas->xa_index += offset << shift; in xas_move_index()
206 unsigned int offset = get_offset(xas->xa_index, node); in xas_descend() local
207 void *entry = xa_entry(xas->xa, node, offset); in xas_descend()
211 offset = xa_to_sibling(entry); in xas_descend()
212 entry = xa_entry(xas->xa, node, offset); in xas_descend()
217 xas->xa_offset = offset; in xas_descend()
384 node->offset = xas->xa_offset; in xas_alloc()
495 xas->xa_offset = node->offset; in xas_delete_node()
526 unsigned int offset = 0; in xas_free_nodes() local
530 void *entry = xa_entry_locked(xas->xa, node, offset); in xas_free_nodes()
534 offset = 0; in xas_free_nodes()
538 RCU_INIT_POINTER(node->slots[offset], XA_RETRY_ENTRY); in xas_free_nodes()
539 offset++; in xas_free_nodes()
540 while (offset == XA_CHUNK_SIZE) { in xas_free_nodes()
544 offset = node->offset + 1; in xas_free_nodes()
613 xa_to_node(head)->offset = 0; in xas_expand()
664 unsigned int offset = xas->xa_offset; in xas_create() local
667 entry = xa_entry_locked(xa, node, offset); in xas_create()
668 slot = &node->slots[offset]; in xas_create()
730 xas->xa_offset = node->offset - 1; in xas_create_range()
731 if (node->offset != 0) in xas_create_range()
780 unsigned int offset, max; in xas_store() local
802 offset = xas->xa_offset; in xas_store()
805 slot = &node->slots[offset]; in xas_store()
828 if (offset == max) in xas_store()
833 if (offset == XA_CHUNK_MASK) in xas_store()
836 next = xa_entry_locked(xas->xa, node, ++offset); in xas_store()
838 if (!entry && (offset > max)) in xas_store()
880 unsigned int offset = xas->xa_offset; in xas_set_mark() local
886 if (node_set_mark(node, offset, mark)) in xas_set_mark()
888 offset = node->offset; in xas_set_mark()
909 unsigned int offset = xas->xa_offset; in xas_clear_mark() local
915 if (!node_clear_mark(node, offset, mark)) in xas_clear_mark()
920 offset = node->offset; in xas_clear_mark()
957 static unsigned int node_get_marks(struct xa_node *node, unsigned int offset) in node_get_marks() argument
963 if (node_get_mark(node, offset, mark)) in node_get_marks()
986 static void node_set_marks(struct xa_node *node, unsigned int offset, in node_set_marks() argument
994 node_set_mark(node, offset, mark); in node_set_marks()
1072 unsigned int offset, marks; in xas_split() local
1083 offset = xas->xa_offset + sibs; in xas_split()
1090 child->offset = offset; in xas_split()
1095 node_set_marks(node, offset, child, xas->xa_sibs, in xas_split()
1097 rcu_assign_pointer(node->slots[offset], in xas_split()
1103 unsigned int canon = offset - xas->xa_sibs; in xas_split()
1107 while (offset > canon) in xas_split()
1108 rcu_assign_pointer(node->slots[offset--], in xas_split()
1113 } while (offset-- > xas->xa_offset); in xas_split()
1145 unsigned long offset = xas->xa_offset; in xas_pause() local
1146 while (++offset < XA_CHUNK_SIZE) { in xas_pause()
1147 if (!xa_is_sibling(xa_entry(xas->xa, node, offset))) in xas_pause()
1150 xas->xa_index += (offset - xas->xa_offset) << node->shift; in xas_pause()
1181 xas->xa_offset = xas->xa_node->offset - 1; in __xas_prev()
1220 xas->xa_offset = xas->xa_node->offset + 1; in __xas_next()
1278 xas->xa_offset = xas->xa_node->offset + 1; in xas_find()
1325 unsigned int offset; in xas_find_marked() local
1354 xas->xa_offset = xas->xa_node->offset + 1; in xas_find_marked()
1370 offset = xas_find_chunk(xas, advance, mark); in xas_find_marked()
1371 if (offset > xas->xa_offset) { in xas_find_marked()
1373 xas_move_index(xas, offset); in xas_find_marked()
1377 xas->xa_offset = offset; in xas_find_marked()
1378 if (offset == XA_CHUNK_SIZE) in xas_find_marked()
1440 xas->xa_offset = xas->xa_node->offset; in xas_find_conflict()
1688 unsigned int offset = XA_CHUNK_MASK; in xas_set_range() local
1695 if ((sibs == XA_CHUNK_MASK) && (offset < XA_CHUNK_MASK)) in xas_set_range()
1698 if (offset == XA_CHUNK_MASK) in xas_set_range()
1699 offset = sibs & XA_CHUNK_MASK; in xas_set_range()
1704 offset = first & XA_CHUNK_MASK; in xas_set_range()
1705 if (offset + sibs > XA_CHUNK_MASK) in xas_set_range()
1706 sibs = XA_CHUNK_MASK - offset; in xas_set_range()
2218 .xa_index = (unsigned long)node->offset << in xa_delete_node()
2221 .xa_offset = node->offset, in xa_delete_node()
2274 node, node->parent ? "offset" : "max", node->offset, in xa_dump_node()