summaryrefslogtreecommitdiff
path: root/lib/xarray.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-02-27 07:37:40 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2020-02-27 07:37:40 -0500
commitd8e93e3f22d9fd2e6a3ccae3623c3af8789ccfc0 (patch)
treee125224c51ccab31358311660a79f176175edf2f /lib/xarray.c
parent3a00e7c47c382b30524e78b36ab047c16b8fcfef (diff)
XArray: Optimise xas_sibling() if !CONFIG_XARRAY_MULTI
If CONFIG_XARRAY_MULTI is disabled, then xas_sibling() must be false. Reported-by: JaeJoon Jung <rgbi3307@gmail.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'lib/xarray.c')
-rw-r--r--lib/xarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xarray.c b/lib/xarray.c
index 05324cf571f4..f448bcd263ac 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -1836,7 +1836,7 @@ 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) >