[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200330123643.17120-8-richard.weiyang@gmail.com>
Date: Mon, 30 Mar 2020 12:36:41 +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 7/9] XArray: the NULL xa_node condition is handled in xas_top
>From the last if/else check, it handles the NULL/non-NULL xa_node
mutually exclusively. While the NULL xa_node case is handled in the
first condition xas_top().
Just remove the redundant handling for NULL xa_node.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
---
lib/xarray.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/xarray.c b/lib/xarray.c
index 0c5b44def3aa..82570bbbf2a5 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -650,16 +650,12 @@ static void *xas_create(struct xa_state *xas, bool allow_root)
slot = &xa->xa_head;
} else if (xas_error(xas)) {
return NULL;
- } else if (node) {
+ } else {
unsigned int offset = xas->xa_offset;
shift = node->shift;
entry = xa_entry_locked(xa, node, offset);
slot = &node->slots[offset];
- } else {
- shift = 0;
- entry = xa_head_locked(xa);
- slot = &xa->xa_head;
}
while (shift > order) {
--
2.23.0
Powered by blists - more mailing lists