[PATCH] fix maple/vma tests in shared place

From: Lorenzo Stoakes
Date: Sun Aug 10 2025 - 10:21:42 EST


Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
---
tools/testing/shared/maple-shared.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/tools/testing/shared/maple-shared.h b/tools/testing/shared/maple-shared.h
index dc4d30f3860b..572cd2580123 100644
--- a/tools/testing/shared/maple-shared.h
+++ b/tools/testing/shared/maple-shared.h
@@ -9,5 +9,20 @@
#include <stdlib.h>
#include <time.h>
#include "linux/init.h"
+#include <linux/maple_tree.h>
+
+static inline void free_node(struct rcu_head *head)
+{
+ struct maple_node *node = container_of(head, struct maple_node, rcu);
+
+ free(node);
+}
+
+static inline void kfree_rcu_node(struct maple_node *node)
+{
+ call_rcu(&node->rcu, free_node);
+}
+
+#define kfree_rcu(ptr, memb) kfree_rcu_node(ptr)

#endif /* __MAPLE_SHARED_H__ */
--
2.50.1