• Home
  • Raw
  • Download

Lines Matching refs:shift

144 	return (index >> node->shift) & XA_CHUNK_MASK;  in get_offset()
155 unsigned int shift = xas->xa_node->shift; in xas_move_index() local
156 xas->xa_index &= ~XA_CHUNK_MASK << shift; in xas_move_index()
157 xas->xa_index += offset << shift; in xas_move_index()
193 if ((xas->xa_index >> xa_to_node(entry)->shift) > XA_CHUNK_MASK) in xas_start()
238 if (xas->xa_shift > node->shift) in xas_load()
241 if (node->shift == 0) in xas_load()
355 static void *xas_alloc(struct xa_state *xas, unsigned int shift) in xas_alloc() argument
384 XA_NODE_BUG_ON(node, shift > BITS_PER_LONG); in xas_alloc()
386 node->shift = shift; in xas_alloc()
430 return (XA_CHUNK_SIZE << xa_to_node(entry)->shift) - 1; in max_index()
447 if (!xa_is_node(entry) && node->shift) in xas_shrink()
527 if (node->shift && xa_is_node(entry)) { in xas_free_nodes()
559 unsigned int shift = 0; in xas_expand() local
565 while ((max >> shift) >= XA_CHUNK_SIZE) in xas_expand()
566 shift += XA_CHUNK_SHIFT; in xas_expand()
567 return shift + XA_CHUNK_SHIFT; in xas_expand()
570 shift = node->shift + XA_CHUNK_SHIFT; in xas_expand()
577 XA_NODE_BUG_ON(node, shift > BITS_PER_LONG); in xas_expand()
578 node = xas_alloc(xas, shift); in xas_expand()
615 shift += XA_CHUNK_SHIFT; in xas_expand()
619 return shift; in xas_expand()
641 int shift; in xas_create() local
649 shift = xas_expand(xas, entry); in xas_create()
650 if (shift < 0) in xas_create()
652 if (!shift && !allow_root) in xas_create()
653 shift = XA_CHUNK_SHIFT; in xas_create()
661 shift = node->shift; in xas_create()
665 shift = 0; in xas_create()
670 while (shift > order) { in xas_create()
671 shift -= XA_CHUNK_SHIFT; in xas_create()
673 node = xas_alloc(xas, shift); in xas_create()
703 unsigned char shift = xas->xa_shift; in xas_create_range() local
706 xas->xa_index |= ((sibs + 1) << shift) - 1; in xas_create_range()
707 if (xas_is_node(xas) && xas->xa_node->shift == xas->xa_shift) in xas_create_range()
730 xas->xa_shift = shift; in xas_create_range()
789 if (node && (xas->xa_shift < node->shift)) in xas_store()
814 if (xa_is_node(next) && (!node || node->shift)) in xas_store()
977 xas->xa_index += (offset - xas->xa_offset) << node->shift; in xas_pause()
1095 } else if (!xas->xa_node->shift && in xas_find()
1175 xas->xa_offset = xas->xa_index >> xas->xa_node->shift; in xas_find_marked()
1256 if (xas->xa_node->shift > xas->xa_shift) in xas_find_conflict()
1260 if (xas->xa_node->shift == xas->xa_shift) { in xas_find_conflict()
1510 unsigned int shift = 0; in xas_set_range() local
1521 shift += XA_CHUNK_SHIFT; in xas_set_range()
1531 if ((((first + sibs + 1) << shift) - 1) > last) in xas_set_range()
1534 xas->xa_shift = shift; in xas_set_range()
1839 mask = (XA_CHUNK_SIZE << node->shift) - 1; in xas_sibling()
1840 return (xas->xa_index & mask) > (xas->xa_offset << node->shift); in xas_sibling()
2016 node->parent, node->shift, node->count, node->nr_values, in xa_dump_node()
2024 void xa_dump_index(unsigned long index, unsigned int shift) in xa_dump_index() argument
2026 if (!shift) in xa_dump_index()
2028 else if (shift >= BITS_PER_LONG) in xa_dump_index()
2031 pr_info("%lu-%lu: ", index, index | ((1UL << shift) - 1)); in xa_dump_index()
2034 void xa_dump_entry(const void *entry, unsigned long index, unsigned long shift) in xa_dump_entry() argument
2039 xa_dump_index(index, shift); in xa_dump_entry()
2042 if (shift == 0) { in xa_dump_entry()
2050 index + (i << node->shift), node->shift); in xa_dump_entry()
2070 unsigned int shift = 0; in xa_dump() local
2076 shift = xa_to_node(entry)->shift + XA_CHUNK_SHIFT; in xa_dump()
2077 xa_dump_entry(entry, 0, shift); in xa_dump()