maple tree: add some comments
authorDev Jain <dev.jain@arm.com>
Thu, 3 Jul 2025 06:33:38 +0000 (12:03 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 13 Jul 2025 23:38:24 +0000 (16:38 -0700)
commit526f36f3f47b9ad29ffb1bf668b7f295287ee11b
tree3dc74b0973a9316d101f41c32f188956c3c76c2c
parent8aa2c0bf0aa92044c8f20ba250448356da509859
maple tree: add some comments

Add comments explaining the fields for maple_metadata, since "end" is
ambiguous and "gap" can be confused as the largest gap, whereas it is
actually the offset of the largest gap.

Add comment for mas_ascend() to explain, whose min and max we are trying
to find.  Explain that, for example, if we are already on offset zero,
then the parent min is mas->min, otherwise we need to walk up to find the
implied pivot min.

Link: https://lkml.kernel.org/r/20250703063338.51509-1-dev.jain@arm.com
Signed-off-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/maple_tree.h
lib/maple_tree.c