Lines Matching +full:multi +full:- +full:function
1 .. SPDX-License-Identifier: GPL-2.0+
15 next or previous entry in a cache-efficient manner. In contrast to a
17 order to grow the array. It is more memory-efficient, parallelisable
18 and cache friendly than a doubly-linked list. It takes advantage of
28 Normal pointers may be stored in the XArray directly. They must be 4-byte
30 alloc_page(). It isn't true for arbitrary user-space pointers,
31 nor for function pointers. You can store pointers to statically allocated
54 the range. Storing to any index will store to all of them. Multi-index
64 allocated ones. A freshly-initialised XArray contains a ``NULL``
84 returns ``-EBUSY`` if the entry is not empty.
100 will not need to allocate memory. The xa_reserve() function
109 If all entries in the array are ``NULL``, the xa_empty() function
118 ------------
131 Setting or clearing a mark on any index of a multi-index entry will
143 ------------------
171 -----------------
186 -------
256 xa_init_flags(&foo->array, XA_FLAGS_LOCK_BH);
263 xa_lock_bh(&foo->array);
264 err = xa_err(__xa_store(&foo->array, index, entry, GFP_KERNEL));
266 foo->count++;
267 xa_unlock_bh(&foo->array);
274 xa_lock(&foo->array);
275 __xa_erase(&foo->array, index);
276 foo->count--;
277 xa_unlock(&foo->array);
314 to use the xa_lock or the RCU lock while doing read-only operations on
317 advanced API is only available to modules with a GPL-compatible license.
352 ----------------
359 .. flat-table::
362 * - Name
363 - Test
364 - Usage
366 * - Node
367 - xa_is_node()
368 - An XArray node. May be visible when using a multi-index xa_state.
370 * - Sibling
371 - xa_is_sibling()
372 - A non-canonical entry for a multi-index entry. The value indicates
375 * - Retry
376 - xa_is_retry()
377 - This entry is currently being modified by a thread which has the
382 * - Zero
383 - xa_is_zero()
384 - Zero entries appear as ``NULL`` through the Normal API, but occupy
393 ------------------------
395 The xas_create_range() function allocates all the necessary memory
409 xas_reload() to save a function call.
425 a function call in the majority of cases at the expense of emitting more
428 The xas_find_marked() function is similar. If the xa_state has
432 function is the equivalent of xas_next_entry().
436 the iteration. The xas_pause() function exists for this purpose.
448 You can call xas_set_update() to have a callback function
453 Multi-Index Entries
454 -------------------
462 eg indices 64-127 may be tied together, but 2-6 may not be. This may
466 You can create a multi-index entry by using XA_STATE_ORDER()
468 Calling xas_load() with a multi-index xa_state will walk the
476 If xas_load() encounters a multi-index entry, the xa_index
479 of a multi-index entry, it will not be altered. Subsequent calls
484 Using xas_next() or xas_prev() with a multi-index xa_state is not
485 supported. Using either of these functions on a multi-index entry will
488 Storing ``NULL`` into any index of a multi-index entry will set the
489 entry at every index to ``NULL`` and dissolve the tie. A multi-index
497 .. kernel-doc:: include/linux/xarray.h
498 .. kernel-doc:: lib/xarray.c