From: Liam R. Howlett Date: Sun, 20 Feb 2022 15:35:28 +0000 (-0500) Subject: Fix maple_big_node struct gap calc. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2bc4594677f01dc06465cdda97820b9b4a2901d5;p=users%2Fjedix%2Flinux-maple.git Fix maple_big_node struct gap calc. Signed-off-by: Liam R. Howlett --- 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;