diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-08-07 16:41:01 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-08-07 16:41:01 -0700 |
| commit | 9e8238020c5beba64e7ffafbb7ea0fb02fe68270 (patch) | |
| tree | 37c7fd953cfa7ebd3d6c476bc4c7d4de2302cdc3 /include/linux/xarray.h | |
| parent | a50ca29523b18baea548bdf5df9b4b923c2bb4f6 (diff) | |
| parent | d862a3068ea593dc904ef524d8548467755ce36f (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 5.9 merge window.
Diffstat (limited to 'include/linux/xarray.h')
| -rw-r--r-- | include/linux/xarray.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h index f73e1775ded0..14c893433139 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -32,8 +32,8 @@ * The following internal entries have a special meaning: * * 0-62: Sibling entries - * 256: Zero entry - * 257: Retry entry + * 256: Retry entry + * 257: Zero entry * * Errors are also represented as internal entries, but use the negative * space (-4094 to -2). They're never stored in the slots array; only @@ -1648,6 +1648,7 @@ static inline void *xas_next_marked(struct xa_state *xas, unsigned long max, xa_mark_t mark) { struct xa_node *node = xas->xa_node; + void *entry; unsigned int offset; if (unlikely(xas_not_node(node) || node->shift)) @@ -1659,7 +1660,10 @@ static inline void *xas_next_marked(struct xa_state *xas, unsigned long max, return NULL; if (offset == XA_CHUNK_SIZE) return xas_find_marked(xas, max, mark); - return xa_entry(xas->xa, node, offset); + entry = xa_entry(xas->xa, node, offset); + if (!entry) + return xas_find_marked(xas, max, mark); + return entry; } /* |
