OSDN Git Service

maple_tree: update mt_validate()
authorPeng Zhang <zhangpeng.00@bytedance.com>
Tue, 11 Jul 2023 03:54:42 +0000 (11:54 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:12:22 +0000 (10:12 -0700)
commita489539e33c29b469bcd023a32c99078c2597c7c
treefc2e2652dea79180de335dbd54eec5a8a134004e
parent33af39d0244ce4944ab16728f7b04df9dfc6d365
maple_tree: update mt_validate()

Instead of using mas_first_entry() to find the leftmost leaf, use a simple
loop instead.  Remove an unneeded check for root node.  To make the error
message more accurate, check pivots first and then slots, because checking
slots depend on the node limit pivot to break the loop.

Link: https://lkml.kernel.org/r/20230711035444.526-7-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c