lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/9] XArray: handle a NULL head by itself
Date
For a NULL head, xas_expand() return the proper shift directly without
other handling.

Let's take this out to emphasize it is handled specially.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
lib/xarray.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/xarray.c b/lib/xarray.c
index 6454cf3f5b4c..1a092c87fca5 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -559,9 +559,10 @@ static int xas_expand(struct xa_state *xas, void *head)
unsigned int shift = 0;
unsigned long max = xas_max(xas);

- if (!head) {
+ if (!head)
return roundup(fls_long(max), XA_CHUNK_SHIFT);
- } else if (xa_is_node(head)) {
+
+ if (xa_is_node(head)) {
node = xa_to_node(head);
shift = node->shift + XA_CHUNK_SHIFT;
}
--
2.23.0
\
 
 \ /
  Last update: 2020-03-30 14:38    [W:0.122 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site