summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/crush/crush.c7
-rw-r--r--src/crush/crush.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/crush/crush.c b/src/crush/crush.c
index 19a765228e9..1e83eb866bb 100644
--- a/src/crush/crush.c
+++ b/src/crush/crush.c
@@ -116,7 +116,7 @@ void crush_destroy(struct crush_map *map)
if (map->rules) {
__u32 b;
for (b = 0; b < map->max_rules; b++)
- kfree(map->rules[b]);
+ crush_destroy_rule(map->rules[b]);
kfree(map->rules);
}
@@ -124,6 +124,11 @@ void crush_destroy(struct crush_map *map)
kfree(map);
}
+void crush_destroy_rule(struct crush_rule *rule)
+{
+ kfree(rule);
+}
+
// methods to check for safe arithmetic operations
int crush_addition_is_unsafe(__u32 a, __u32 b)
{
diff --git a/src/crush/crush.h b/src/crush/crush.h
index 9fd37e9e516..82d032879d9 100644
--- a/src/crush/crush.h
+++ b/src/crush/crush.h
@@ -185,6 +185,7 @@ extern void crush_destroy_bucket_list(struct crush_bucket_list *b);
extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b);
extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b);
extern void crush_destroy_bucket(struct crush_bucket *b);
+extern void crush_destroy_rule(struct crush_rule *r);
extern void crush_destroy(struct crush_map *map);
static inline int crush_calc_tree_node(int i)