]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: Revise limit checks in mas_empty_area{_rev}()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 20 Apr 2023 13:17:34 +0000 (09:17 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 27 Apr 2023 01:40:55 +0000 (21:40 -0400)
commitc7ef3210f3abd57ff606aec8ee68916804317530
tree7197160579912facc73e1497cdcdf4bc28dfd445
parent8c2535ce0d60b492dd9c77f43a7085c3197f3e7d
maple_tree: Revise limit checks in mas_empty_area{_rev}()

Since the maple tree is inclusive in range, ensure that a range of 1
(min = max) works for searching for a gap in either direction, and make
sure the size is at least 1 but not larger than the delta between min
and max.

This commit also updates the testing.  Unfortunately there isn't a way
to safely update the tests and code without a test failure.

Suggested-by: Peng Zhang <zhangpeng.00@bytedance.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c
lib/test_maple_tree.c