• Home
  • Raw
  • Download

Lines Matching +full:zero +full:- +full:initialised

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 Each non-``NULL`` entry in the array has three bits associated with
32 Normal pointers may be stored in the XArray directly. They must be 4-byte
34 alloc_page(). It isn't true for arbitrary user-space pointers,
60 Storing to any index will store to all of them. Multi-index entries can
69 allocated ones. A freshly-initialised XArray contains a ``NULL``
88 returns ``-EBUSY`` if the entry is not empty.
128 ------------------
156 -----------------
171 -------
239 xa_init_flags(&foo->array, XA_FLAGS_LOCK_BH);
246 xa_lock_bh(&foo->array);
247 err = xa_err(__xa_store(&foo->array, index, entry, GFP_KERNEL));
249 foo->count++;
250 xa_unlock_bh(&foo->array);
257 xa_lock(&foo->array);
258 __xa_erase(&foo->array, index);
259 foo->count--;
260 xa_unlock(&foo->array);
297 to use the xa_lock or the RCU lock while doing read-only operations on
300 advanced API is only available to modules with a GPL-compatible license.
331 ----------------
338 .. flat-table::
341 * - Name
342 - Test
343 - Usage
345 * - Node
346 - xa_is_node()
347 - An XArray node. May be visible when using a multi-index xa_state.
349 * - Sibling
350 - xa_is_sibling()
351 - A non-canonical entry for a multi-index entry. The value indicates
354 * - Retry
355 - xa_is_retry()
356 - This entry is currently being modified by a thread which has the
361 * - Zero
362 - xa_is_zero()
363 - Zero entries appear as ``NULL`` through the Normal API, but occupy
372 ------------------------
433 Multi-Index Entries
434 -------------------
442 eg indices 64-127 may be tied together, but 2-6 may not be. This may
446 You can create a multi-index entry by using XA_STATE_ORDER()
448 Calling xas_load() with a multi-index xa_state will walk the
456 If xas_load() encounters a multi-index entry, the xa_index
459 of a multi-index entry, it will not be altered. Subsequent calls
464 Using xas_next() or xas_prev() with a multi-index xa_state
465 is not supported. Using either of these functions on a multi-index entry
468 Storing ``NULL`` into any index of a multi-index entry will set the entry
469 at every index to ``NULL`` and dissolve the tie. Splitting a multi-index
475 .. kernel-doc:: include/linux/xarray.h
476 .. kernel-doc:: lib/xarray.c