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 into any entry will cause the XArray to forget about the range.
67 using xa_load(). xa_store will overwrite any entry with the
68 new entry and return the previous entry stored at that index. You can
70 ``NULL`` entry. There is no difference between an entry that has never
74 You can conditionally replace an entry at an index by using
76 the entry at that index has the 'old' value. It also returns the entry
77 which was at that index; if it returns the same entry which was passed as
80 If you want to only store a new entry to an index if the current entry
82 returns ``-EBUSY`` if the entry is not empty.
88 present entry in the XArray.
90 Calling xa_store_range() stores the same entry in a range
92 in a slightly odd way. For example, marking the entry at one index
93 may result in the entry being marked at some, but not all of the other
94 indices. Storing into one index may result in the entry retrieved by
99 will store a reserved entry at the indicated index. Users of the
100 normal API will see this entry as containing ``NULL``. If you do
101 not need to use the reserved entry, you can call xa_release()
102 to remove the unused entry. If another user has stored to the entry
104 want the entry to become ``NULL``, you should use xa_erase().
105 Using xa_insert() on a reserved entry will fail.
118 Each entry in the array has three bits associated with it called marks.
122 You can enquire whether a mark is set on an entry by using
123 xa_get_mark(). If the entry is not ``NULL``, you can set a mark on it
124 by using xa_set_mark() and remove the mark from an entry by calling
125 xa_clear_mark(). You can ask whether any entry in the XArray has a
126 particular mark set by calling xa_marked(). Erasing an entry from the
127 XArray causes all marks associated with that entry to be cleared.
129 Setting or clearing a mark on any index of a multi-index entry will
130 affect all indices covered by that entry. Querying the mark on any
147 You can call xa_alloc() to store the entry at an unused index
153 also mark the entry as being allocated. Unlike a normal XArray, storing
154 ``NULL`` will mark the entry as being in use, like xa_reserve().
155 To free an entry, use xa_erase() (or xa_release() if
156 you only want to free the entry if it's ``NULL``).
158 By default, the lowest free entry is allocated starting from 0. If you
165 is used to track whether an entry is free or not. The other marks are
173 parameter in case the XArray needs to allocate memory to store this entry.
174 If the entry is being deleted, no memory allocation needs to be performed,
227 Assumes xa_lock held on entry:
257 int foo_store(struct foo *foo, unsigned long index, void *entry)
262 err = xa_err(__xa_store(&foo->array, index, entry, GFP_KERNEL));
301 available for situations where you look up an entry and want to atomically
370 - A non-canonical entry for a multi-index entry. The value indicates
371 which slot in this node has the canonical entry.
375 - This entry is currently being modified by a thread which has the
376 xa_lock. The node containing this entry may be freed at the end
383 an entry in the XArray which can be used to reserve the index for
394 to store every entry in a range. It will set ENOMEM in the xa_state if
397 You can use xas_init_marks() to reset the marks on an entry
400 and all other marks are clear. Replacing one entry with another using
401 xas_store() will not reset the marks on that entry; if you want
404 The xas_load() will walk the xa_state as close to the entry
406 entry and need to check that the entry hasn't changed, you can use
417 You can search for the next present entry using xas_find(). This
419 if the cursor has been walked to an entry, then it will find the next
420 entry after the one currently referenced. If not, it will return the
421 entry at the index of the xa_state. Using xas_next_entry() to
422 move to the next present entry instead of xas_find() will save
427 not been walked, it will return the entry at the index of the xa_state,
428 if it is marked. Otherwise, it will return the first marked entry after
429 the entry referenced by the xa_state. The xas_next_marked()
436 is in an appropriate state to continue the iteration after the entry
456 any index will change the value of the entry retrieved from any index.
464 You can create a multi-index entry by using XA_STATE_ORDER()
468 meaningful, potentially being an internal entry or ``NULL`` even when there
469 is an entry stored within the range. Calling xas_find_conflict()
470 will return the first entry within the range or ``NULL`` if there are no
472 iterate over every entry which overlaps the specified range.
474 If xas_load() encounters a multi-index entry, the xa_index
477 of a multi-index entry, it will not be altered. Subsequent calls
479 Each entry will only be returned once, no matter how many indices it
483 supported. Using either of these functions on a multi-index entry will
486 Storing ``NULL`` into any index of a multi-index entry will set the
487 entry at every index to ``NULL`` and dissolve the tie. A multi-index
488 entry can be split into entries occupying smaller ranges by calling