[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200330123643.17120-10-richard.weiyang@gmail.com>
Date: Mon, 30 Mar 2020 12:36:43 +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 9/9] XArray: adjust xa_offset till it gets the correct node
During xas_create_range(), it will go up the tree for next create.
Currently, during moving up the tree, the xa_offset is adjusted every
thime. This is not necessary. Only the offset for the last one matters.
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 01f64a000e14..9546b2b2dce1 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -712,9 +712,10 @@ void xas_create_range(struct xa_state *xas)
for (;;) {
struct xa_node *node = xas->xa_node;
xas->xa_node = xa_parent_locked(xas->xa, node);
- xas->xa_offset = node->offset - 1;
- if (node->offset != 0)
+ if (node->offset != 0) {
+ xas->xa_offset = node->offset - 1;
break;
+ }
}
}
--
2.23.0
Powered by blists - more mailing lists