Lines Matching defs:index
24 * @index is the index of the entry being operated on
28 * @offset is the index into the slots array inside an xa_node.
143 /* extracts the offset within this node from the index */
144 static unsigned int get_offset(unsigned long index, struct xa_node *node)
146 return (index >> node->shift) & XA_CHUNK_MASK;
154 /* move the index either forwards (find) or backwards (sibling slot) */
177 * error state, return NULL. If the index is outside the current scope
228 * If the xa_state is set up to operate on a multi-index entry, xas_load()
408 * Use this to calculate the maximum index that will need to be created
410 * multi-index entry at index 0, the calculation is a little more complex
429 /* The maximum index that can be contained in the array without expanding it */
700 * create single-index entries and positions it at the beginning of the
702 * converted to use multi-index entries.
706 unsigned long index = xas->xa_index;
720 if (xas->xa_index <= (index | XA_CHUNK_MASK))
738 xas->xa_index = index;
741 xas->xa_index = index;
767 * If @xas is operating on a multi-index entry, the entry returned by this
773 * Return: The old entry at this index.
1044 * xas_split() - Split a multi-index entry into smaller entries.
1224 * @max: Highest index to return.
1227 * which has an index >= xas.xa_index. If it has been walked, the entry
1232 * is set to the smallest index not yet in the array. This allows @xas
1288 * @max: Highest index to return.
1292 * which has an index >= xas.xa_index. If it has been walked, the entry
1294 * first marked entry with an index > xas.xa_index.
1297 * set to the bounds state and xas->xa_index is set to the smallest index
1449 * @index: index into array.
1452 * Return: The entry at @index in @xa.
1454 void *xa_load(struct xarray *xa, unsigned long index)
1456 XA_STATE(xas, xa, index);
1483 * @index: Index into array.
1485 * After this function returns, loading from @index will return %NULL.
1486 * If the index is part of a multi-index entry, all indices will be erased
1487 * and none of the entries will be part of a multi-index entry.
1490 * Return: The entry which used to be at this index.
1492 void *__xa_erase(struct xarray *xa, unsigned long index)
1494 XA_STATE(xas, xa, index);
1502 * @index: Index of entry.
1504 * After this function returns, loading from @index will return %NULL.
1505 * If the index is part of a multi-index entry, all indices will be erased
1506 * and none of the entries will be part of a multi-index entry.
1509 * Return: The entry which used to be at this index.
1511 void *xa_erase(struct xarray *xa, unsigned long index)
1516 entry = __xa_erase(xa, index);
1526 * @index: Index into array.
1536 * Return: The old entry at this index or xa_err() if an error happened.
1538 void *__xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
1540 XA_STATE(xas, xa, index);
1561 * @index: Index into array.
1565 * After this function returns, loads from this index will return @entry.
1566 * Storing into an existing multi-index entry updates the entry of every index.
1567 * The marks associated with @index are unaffected unless @entry is %NULL.
1571 * Return: The old entry at this index on success, xa_err(-EINVAL) if @entry
1575 void *xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
1580 curr = __xa_store(xa, index, entry, gfp);
1590 * @index: Index into array.
1601 * Return: The old entry at this index or xa_err() if an error happened.
1603 void *__xa_cmpxchg(struct xarray *xa, unsigned long index,
1606 XA_STATE(xas, xa, index);
1628 * @index: Index into array.
1634 * present, even though loading from this index will return NULL.
1641 int __xa_insert(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
1643 XA_STATE(xas, xa, index);
1701 * @first: First index to affect.
1702 * @last: Last index to affect.
1706 * After this function returns, loads from any index between @first and @last,
1708 * Storing into an existing multi-index entry updates the entry of every index.
1709 * The marks associated with @index are unaffected unless @entry is %NULL.
1755 * @index: Index of the entry.
1759 int xa_get_order(struct xarray *xa, unsigned long index)
1761 XA_STATE(xas, xa, index);
1802 * stores the index into the @id pointer, then stores the entry at
1803 * that index. A concurrent lookup will not see an uninitialised @id.
1851 * stores the index into the @id pointer, then stores the entry at
1852 * that index. A concurrent lookup will not see an uninitialised @id.
1897 * @index: Index of entry.
1904 void __xa_set_mark(struct xarray *xa, unsigned long index, xa_mark_t mark)
1906 XA_STATE(xas, xa, index);
1917 * @index: Index of entry.
1922 void __xa_clear_mark(struct xarray *xa, unsigned long index, xa_mark_t mark)
1924 XA_STATE(xas, xa, index);
1935 * @index: Index of entry.
1942 * Return: True if the entry at @index has this mark set, false if it doesn't.
1944 bool xa_get_mark(struct xarray *xa, unsigned long index, xa_mark_t mark)
1946 XA_STATE(xas, xa, index);
1967 * @index: Index of entry.
1974 void xa_set_mark(struct xarray *xa, unsigned long index, xa_mark_t mark)
1977 __xa_set_mark(xa, index, mark);
1985 * @index: Index of entry.
1992 void xa_clear_mark(struct xarray *xa, unsigned long index, xa_mark_t mark)
1995 __xa_clear_mark(xa, index, mark);
2003 * @indexp: Pointer to an index.
2004 * @max: Maximum index to search to.
2008 * index that is at least @indexp and no more than @max.
2009 * If an entry is found, @indexp is updated to be the index of the entry.
2053 * @indexp: Pointer to an index.
2054 * @max: Maximum index to search to.
2058 * index that is above @indexp and no more than @max.
2059 * If an entry is found, @indexp is updated to be the index of the entry.
2140 * @start: The first index in the XArray eligible to be selected.
2141 * @max: The last index in the XArray eligible to be selected.
2153 * moment in time. For example, if another thread stores to index 5, then
2154 * index 10, calling xa_extract() may return the old contents of index 5
2155 * and the new contents of index 10. Indices not modified while this
2254 void xa_dump_index(unsigned long index, unsigned int shift)
2257 pr_info("%lu: ", index);
2261 pr_info("%lu-%lu: ", index, index | ((1UL << shift) - 1));
2264 void xa_dump_entry(const void *entry, unsigned long index, unsigned long shift)
2269 xa_dump_index(index, shift);
2280 index + (i << node->shift), node->shift);