]> 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>
Fri, 21 Apr 2023 14:11:32 +0000 (10:11 -0400)
commitb470be47c417cfff21ea538498c9a468de6681d4
treed14ac892c96a7d7fa0ca4cb332dc07dbe15700cd
parent307131d66922397c4aad07e8967e1de17ec5d693
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