diff options
| author | Tony Lindgren <tony@atomide.com> | 2020-04-21 19:36:03 +0300 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2020-04-21 19:36:03 +0300 |
| commit | 175ae3ad59ab3459652bd2ae3bbc1785aeba1bf3 (patch) | |
| tree | c7fd682de61e3c2a6cc3ba0e8881b99fafdf969c /include/linux/xarray.h | |
| parent | 07bdc492cff6f555538df95e9812fe72e16d154a (diff) | |
| parent | 90d4d3f4ea45370d482fa609dbae4d2281b4074f (diff) | |
| download | linux-175ae3ad59ab3459652bd2ae3bbc1785aeba1bf3.tar.xz | |
Merge branch 'fixes-v5.7' into fixes
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; } /* |
