]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: Try harder to keep active node with mas_prev()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 3 Apr 2023 15:57:48 +0000 (11:57 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 27 Apr 2023 01:40:54 +0000 (21:40 -0400)
commit62db8565c78cc61035d5dd612ba9c34c6a32e0ff
treed734422286c8efe810582c65da9157e4ce261c64
parenta9c427896be23aee55574851f9cb0677f0e03962
maple_tree: Try harder to keep active node with mas_prev()

Keep a reference to the node when possible with mas_prev().  This will
avoid re-walking the tree.  In keeping a reference to the node, keep the
last/index accurate to the range being referenced.  This means the limit
may be within the range, but the range may extend outside of the limit.

Also fix the single entry tree to respect the range (of 0), or set the
node to MAS_NONE in the case of shifting beyond 0.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c