OpenCloudOS-Kernel/tools/testing/radix-tree/linux
Matthew Wilcox 58d6ea3085 xarray: Add XArray unconditional store operations
xa_store() differs from radix_tree_insert() in that it will overwrite an
existing element in the array rather than returning an error.  This is
the behaviour which most users want, and those that want more complex
behaviour generally want to use the xas family of routines anyway.

For memory allocation, xa_store() will first attempt to request memory
from the slab allocator; if memory is not immediately available, it will
drop the xa_lock and allocate memory, keeping a pointer in the xa_state.
It does not use the per-CPU cache, although those will continue to exist
until all radix tree users are converted to the xarray.

This patch also includes xa_erase() and __xa_erase() for a streamlined
way to store NULL.  Since there is no need to allocate memory in order
to store a NULL in the XArray, we do not need to trouble the user with
deciding what memory allocation flags to use.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-10-21 10:45:57 -04:00
..
bug.h xarray: Add definition of struct xarray 2018-10-21 10:45:53 -04:00
compiler_types.h radix tree test suite: Fix build 2018-02-25 06:00:11 -05:00
cpu.h redo: radix tree test suite: fix compilation 2016-12-15 11:04:20 -08:00
gfp.h radix tree: use GFP_ZONEMASK bits of gfp_t for flags 2018-04-11 10:28:39 -07:00
idr.h Reimplement IDR and IDA using the radix tree 2017-02-13 21:44:01 -05:00
init.h radix tree test suite: Reduce kernel.h 2017-02-13 16:09:42 -05:00
kconfig.h xarray: Add definition of struct xarray 2018-10-21 10:45:53 -04:00
kernel.h xarray: Add XArray unconditional store operations 2018-10-21 10:45:57 -04:00
kmemleak.h radix tree test harness 2016-03-17 15:09:34 -07:00
lockdep.h xarray: Add XArray unconditional store operations 2018-10-21 10:45:57 -04:00
percpu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
preempt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
radix-tree.h xarray: Replace exceptional entries 2018-09-29 22:47:49 -04:00
rcupdate.h xarray: Add XArray load operation 2018-10-21 10:45:57 -04:00
slab.h radix tree test suite: Fix build 2018-02-25 06:00:11 -05:00
xarray.h radix tree test suite: Fix compilation 2018-08-21 23:31:20 -04:00