[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200330123643.17120-4-richard.weiyang@gmail.com>
Date: Mon, 30 Mar 2020 12:36:37 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: willy@...radead.org
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH 3/9] XArray: handle a NULL head by itself
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@...il.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
Powered by blists - more mailing lists