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)
 
        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);
        }
 
        kfree(map);
 }
 
-
+void crush_destroy_rule(struct crush_rule *rule)
+{
+       kfree(rule);
+}