mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
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:
@@ -1286,6 +1286,8 @@ static inline bool xa_is_advanced(const void *entry)
|
||||
*/
|
||||
typedef void (*xa_update_node_t)(struct xa_node *node);
|
||||
|
||||
void xa_delete_node(struct xa_node *, xa_update_node_t);
|
||||
|
||||
/*
|
||||
* The xa_state is opaque to its users. It contains various different pieces
|
||||
* of state involved in the current operation on the XArray. It should be
|
||||
@@ -1544,10 +1546,21 @@ static inline void xas_split_alloc(struct xa_state *xas, void *entry,
|
||||
static inline void *xas_reload(struct xa_state *xas)
|
||||
{
|
||||
struct xa_node *node = xas->xa_node;
|
||||
void *entry;
|
||||
char offset;
|
||||
|
||||
if (node)
|
||||
return xa_entry(xas->xa, node, xas->xa_offset);
|
||||
return xa_head(xas->xa);
|
||||
if (!node)
|
||||
return xa_head(xas->xa);
|
||||
if (IS_ENABLED(CONFIG_XARRAY_MULTI)) {
|
||||
offset = (xas->xa_index >> node->shift) & XA_CHUNK_MASK;
|
||||
entry = xa_entry(xas->xa, node, offset);
|
||||
if (!xa_is_sibling(entry))
|
||||
return entry;
|
||||
offset = xa_to_sibling(entry);
|
||||
} else {
|
||||
offset = xas->xa_offset;
|
||||
}
|
||||
return xa_entry(xas->xa, node, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1736,13 +1749,12 @@ enum {
|
||||
* @xas: XArray operation state.
|
||||
* @entry: Entry retrieved from the array.
|
||||
*
|
||||
* The loop body will be executed for each entry in the XArray that lies
|
||||
* within the range specified by @xas. If the loop completes successfully,
|
||||
* any entries that lie in this range will be replaced by @entry. The caller
|
||||
* may break out of the loop; if they do so, the contents of the XArray will
|
||||
* be unchanged. The operation may fail due to an out of memory condition.
|
||||
* The caller may also call xa_set_err() to exit the loop while setting an
|
||||
* error to record the reason.
|
||||
* The loop body will be executed for each entry in the XArray that
|
||||
* lies within the range specified by @xas. If the loop terminates
|
||||
* normally, @entry will be %NULL. The user may break out of the loop,
|
||||
* which will leave @entry set to the conflicting entry. The caller
|
||||
* may also call xa_set_err() to exit the loop while setting an error
|
||||
* to record the reason.
|
||||
*/
|
||||
#define xas_for_each_conflict(xas, entry) \
|
||||
while ((entry = xas_find_conflict(xas)))
|
||||
|
Reference in New Issue
Block a user