Lines Matching full:entry

15 next or previous entry in a cache-efficient manner.  In contrast to a
35 You must first convert it into an entry using xa_mk_value().
36 When you retrieve an entry from the XArray, you can check whether it is
37 a value entry by calling xa_is_value(), and convert it back to
41 call xa_tag_pointer() to create an entry with a tag, xa_untag_pointer()
42 to turn a tagged entry back into an untagged pointer and xa_pointer_tag()
43 to retrieve the tag of an entry. Tagged pointers use the same bits that
53 the range will return the same entry as looking up any other index in
56 xa_erase() or xa_store() with ``NULL``) any entry will cause the XArray
68 xa_load(). xa_store() will overwrite any entry with the new entry and
69 return the previous entry stored at that index. You can unset entries
70 using xa_erase() or by setting the entry to ``NULL`` using xa_store().
71 There is no difference between an entry that has never been stored to
72 and one that has been erased with xa_erase(); an entry that has most
76 You can conditionally replace an entry at an index by using
78 the entry at that index has the 'old' value. It also returns the entry
79 which was at that index; if it returns the same entry which was passed as
82 If you want to only store a new entry to an index if the current entry
84 returns ``-EBUSY`` if the entry is not empty.
90 present entry in the XArray.
92 Calling xa_store_range() stores the same entry in a range
94 in a slightly odd way. For example, marking the entry at one index
95 may result in the entry being marked at some, but not all of the other
96 indices. Storing into one index may result in the entry retrieved by
101 will store a reserved entry at the indicated index. Users of the
102 normal API will see this entry as containing ``NULL``. If you do
103 not need to use the reserved entry, you can call xa_release()
104 to remove the unused entry. If another user has stored to the entry
106 want the entry to become ``NULL``, you should use xa_erase().
107 Using xa_insert() on a reserved entry will fail.
120 Each entry in the array has three bits associated with it called marks.
124 You can enquire whether a mark is set on an entry by using
125 xa_get_mark(). If the entry is not ``NULL``, you can set a mark on it
126 by using xa_set_mark() and remove the mark from an entry by calling
127 xa_clear_mark(). You can ask whether any entry in the XArray has a
128 particular mark set by calling xa_marked(). Erasing an entry from the
129 XArray causes all marks associated with that entry to be cleared.
130 Storing a new entry that replaces an existing entry keeps the marks
133 Setting or clearing a mark on any index of a multi-index entry will
134 affect all indices covered by that entry. Querying the mark on any
151 You can call xa_alloc() to store the entry at an unused index
157 also mark the entry as being allocated. Unlike a normal XArray, storing
158 ``NULL`` will mark the entry as being in use, like xa_reserve().
159 To free an entry, use xa_erase() (or xa_release() if
160 you only want to free the entry if it's ``NULL``).
162 By default, the lowest free entry is allocated starting from 0. If you
169 is used to track whether an entry is free or not. The other marks are
177 parameter in case the XArray needs to allocate memory to store this entry.
178 If the entry is being deleted, no memory allocation needs to be performed,
231 Assumes xa_lock held on entry:
261 int foo_store(struct foo *foo, unsigned long index, void *entry)
266 err = xa_err(__xa_store(&foo->array, index, entry, GFP_KERNEL));
305 available for situations where you look up an entry and want to atomically
374 - A non-canonical entry for a multi-index entry. The value indicates
375 which slot in this node has the canonical entry.
379 - This entry is currently being modified by a thread which has the
380 xa_lock. The node containing this entry may be freed at the end
387 an entry in the XArray which can be used to reserve the index for
398 to store every entry in a range. It will set ENOMEM in the xa_state if
401 You can use xas_init_marks() to reset the marks on an entry
404 and all other marks are clear. Replacing one entry with another using
405 xas_store() will not reset the marks on that entry; if you want
408 The xas_load() will walk the xa_state as close to the entry
410 entry and need to check that the entry hasn't changed, you can use
421 You can search for the next present entry using xas_find(). This
423 if the cursor has been walked to an entry, then it will find the next
424 entry after the one currently referenced. If not, it will return the
425 entry at the index of the xa_state. Using xas_next_entry() to
426 move to the next present entry instead of xas_find() will save
431 not been walked, it will return the entry at the index of the xa_state,
432 if it is marked. Otherwise, it will return the first marked entry after
433 the entry referenced by the xa_state. The xas_next_marked()
440 is in an appropriate state to continue the iteration after the entry
460 any index will change the value of the entry retrieved from any index.
468 You can create a multi-index entry by using XA_STATE_ORDER()
472 meaningful, potentially being an internal entry or ``NULL`` even when there
473 is an entry stored within the range. Calling xas_find_conflict()
474 will return the first entry within the range or ``NULL`` if there are no
476 iterate over every entry which overlaps the specified range.
478 If xas_load() encounters a multi-index entry, the xa_index
481 of a multi-index entry, it will not be altered. Subsequent calls
483 Each entry will only be returned once, no matter how many indices it
487 supported. Using either of these functions on a multi-index entry will
490 Storing ``NULL`` into any index of a multi-index entry will set the
491 entry at every index to ``NULL`` and dissolve the tie. A multi-index
492 entry can be split into entries occupying smaller ranges by calling
496 that xas_split_alloc() + xas_split() split the entry from the original
498 iteratively splits the entry containing the index non-uniformly.
499 For example, to split an order-9 entry, which takes 2^(9-6)=8 slots,
501 8 xa_node. xas_try_split() splits the order-9 entry into
502 2 order-8 entries, then split one order-8 entry, based on the given index,
503 to 2 order-7 entries, ..., and split one order-1 entry to 2 order-0 entries.
504 When splitting the order-6 entry and a new xa_node is needed, xas_try_split()