From 2bc4594677f01dc06465cdda97820b9b4a2901d5 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Sun, 20 Feb 2022 10:35:28 -0500 Subject: [PATCH] Fix maple_big_node struct gap calc. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9588c6d1d0c8..5132495f86a6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -106,6 +106,7 @@ static const unsigned char mt_min_slots[] = { #define mt_min_slot_count(x) mt_min_slots[mte_node_type(x)] #define MAPLE_BIG_NODE_SLOTS (MAPLE_RANGE64_SLOTS * 2 + 2) +#define MAPLE_BIG_NODE_GAPS (MAPLE_ARANGE64_SLOTS * 2 + 1) struct maple_big_node { struct maple_pnode *parent; @@ -113,8 +114,8 @@ struct maple_big_node { union { struct maple_enode *slot[MAPLE_BIG_NODE_SLOTS]; struct { - unsigned long padding[MAPLE_BIG_NODE_SLOTS/2 + 2]; - unsigned long gap[MAPLE_BIG_NODE_SLOTS/2 + 2]; + unsigned long padding[MAPLE_BIG_NODE_GAPS]; + unsigned long gap[MAPLE_BIG_NODE_GAPS]; }; }; unsigned long min; -- 2.50.1