diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2020-09-01 14:19:48 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2020-09-01 14:19:48 +0200 |
| commit | ead5d1f4d877e92c051e1a1ade623d0d30e71619 (patch) | |
| tree | cb9db5698a546e7b96f7d5bef5ce544629dd37a2 /lib/xarray.c | |
| parent | f53fa968a7344970b8f8a5707c39cdcf17a6f367 (diff) | |
| parent | b51594df17d0ce80b9f9f35394a1f42d7ac94472 (diff) | |
| download | linux-ead5d1f4d877e92c051e1a1ade623d0d30e71619.tar.gz | |
Merge branch 'master' into for-next
Sync with Linus' branch in order to be able to apply fixups
of more recent patches.
Diffstat (limited to 'lib/xarray.c')
| -rw-r--r-- | lib/xarray.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/xarray.c b/lib/xarray.c index 1d9fab7db8dad5..e9e641d3c0c31b 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -970,7 +970,7 @@ void xas_pause(struct xa_state *xas) xas->xa_node = XAS_RESTART; if (node) { - unsigned int offset = xas->xa_offset; + unsigned long offset = xas->xa_offset; while (++offset < XA_CHUNK_SIZE) { if (!xa_is_sibling(xa_entry(xas->xa, node, offset))) break; @@ -1208,6 +1208,8 @@ void *xas_find_marked(struct xa_state *xas, unsigned long max, xa_mark_t mark) } entry = xa_entry(xas->xa, xas->xa_node, xas->xa_offset); + if (!entry && !(xa_track_free(xas->xa) && mark == XA_FREE_MARK)) + continue; if (!xa_is_node(entry)) return entry; xas->xa_node = xa_to_node(entry); @@ -1836,10 +1838,11 @@ static bool xas_sibling(struct xa_state *xas) struct xa_node *node = xas->xa_node; unsigned long mask; - if (!node) + if (!IS_ENABLED(CONFIG_XARRAY_MULTI) || !node) return false; mask = (XA_CHUNK_SIZE << node->shift) - 1; - return (xas->xa_index & mask) > (xas->xa_offset << node->shift); + return (xas->xa_index & mask) > + ((unsigned long)xas->xa_offset << node->shift); } /** |
