mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
XArray updates for 5.9
- Fix the test suite after introduction of the local_lock - Fix a bug in the IDA spotted by Coverity - Change the API that allows the workingset code to delete a node - Fix xas_reload() when dealing with entries that occupy multiple indices - Add a few more tests to the test suite - Fix an unsigned int being shifted into an unsigned long -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEejHryeLBw/spnjHrDpNsjXcpgj4FAl+OzzAACgkQDpNsjXcp gj5YFgf/cV99dyPaal7AfMwhVwFcuVjIRH4S/VeOHkjS2QT1lpu3ffqfKALVR8vU 3IObM3oDCmLk0mYz9O+V/udVJoBYWiduI0LZhR6+V5ZrDjbw/d4VdCbwOplpeF5x rntyI9r8f5d4LxBJ/moLjsosc1KfCzyVnV389eZRvZ8Muxuyc73WdAwZZZfD79nY 66gScEXQokU99zqJJ1nWfh05XTcTsKF25fVBGMLZTUBAytoFyPuC/kO2z8Uq9lEi Ug6gDClskSB7A2W5gvprMcoUAVYcHfTb0wqJD5/MhkHyoTdcWdW8Re0kssXvD86V KwlBdYQ/JuskgY/hbynZ/FP3p8+t1Q== =12E/ -----END PGP SIGNATURE----- Merge tag 'xarray-5.9' of git://git.infradead.org/users/willy/xarray Pull XArray updates from Matthew Wilcox: - Fix the test suite after introduction of the local_lock - Fix a bug in the IDA spotted by Coverity - Change the API that allows the workingset code to delete a node - Fix xas_reload() when dealing with entries that occupy multiple indices - Add a few more tests to the test suite - Fix an unsigned int being shifted into an unsigned long * tag 'xarray-5.9' of git://git.infradead.org/users/willy/xarray: XArray: Fix xas_create_range for ranges above 4 billion radix-tree: fix the comment of radix_tree_next_slot() XArray: Fix xas_reload for multi-index entries XArray: Add private interface for workingset node deletion XArray: Fix xas_for_each_conflict documentation XArray: Test marked multiorder iterations XArray: Test two more things about xa_cmpxchg ida: Free allocated bitmap in error path radix tree test suite: Fix compilation
This commit is contained in:
commit
c4d6fe7311
11 changed files with 115 additions and 34 deletions
25
lib/xarray.c
25
lib/xarray.c
|
@ -706,7 +706,7 @@ void xas_create_range(struct xa_state *xas)
|
|||
unsigned char shift = xas->xa_shift;
|
||||
unsigned char sibs = xas->xa_sibs;
|
||||
|
||||
xas->xa_index |= ((sibs + 1) << shift) - 1;
|
||||
xas->xa_index |= ((sibs + 1UL) << shift) - 1;
|
||||
if (xas_is_node(xas) && xas->xa_node->shift == xas->xa_shift)
|
||||
xas->xa_offset |= sibs;
|
||||
xas->xa_shift = 0;
|
||||
|
@ -2163,6 +2163,29 @@ unsigned int xa_extract(struct xarray *xa, void **dst, unsigned long start,
|
|||
}
|
||||
EXPORT_SYMBOL(xa_extract);
|
||||
|
||||
/**
|
||||
* xa_delete_node() - Private interface for workingset code.
|
||||
* @node: Node to be removed from the tree.
|
||||
* @update: Function to call to update ancestor nodes.
|
||||
*
|
||||
* Context: xa_lock must be held on entry and will not be released.
|
||||
*/
|
||||
void xa_delete_node(struct xa_node *node, xa_update_node_t update)
|
||||
{
|
||||
struct xa_state xas = {
|
||||
.xa = node->array,
|
||||
.xa_index = (unsigned long)node->offset <<
|
||||
(node->shift + XA_CHUNK_SHIFT),
|
||||
.xa_shift = node->shift + XA_CHUNK_SHIFT,
|
||||
.xa_offset = node->offset,
|
||||
.xa_node = xa_parent_locked(node->array, node),
|
||||
.xa_update = update,
|
||||
};
|
||||
|
||||
xas_store(&xas, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xa_delete_node); /* For the benefit of the test suite */
|
||||
|
||||
/**
|
||||
* xa_destroy() - Free all internal data structures.
|
||||
* @xa: XArray.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue