]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: move debug check to __mas_set_range()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 1 Nov 2023 17:16:20 +0000 (13:16 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:21 +0000 (13:16 -0800)
commit2b712c5527fce710c49c9d1fb0c06b58a27e28ab
treecad9451bc0b676bd63ff6b98b025cef0b3d2dc7e
parent0e957681c7dbd4a76de039f70991e9f060eb1415
maple_tree: move debug check to __mas_set_range()

__mas_set_range() was created to shortcut resetting the maple state and a
debug check was added to the caller (the vma iterator) to ensure the
internal maple state remains safe to use.  Move the debug check from the
vma iterator into the maple tree itself so other users do not incorrectly
use the advanced maple state modification.

Fallout from this change include a large amount of debug setup needed to
be moved to earlier in the header, and the maple_tree.h radix-tree test
code needed to move the inclusion of the header to after the atomic
define.  None of those changes have functional changes.

Link: https://lkml.kernel.org/r/20231101171629.3612299-4-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/maple_tree.h
mm/internal.h
tools/testing/radix-tree/linux/maple_tree.h