]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: factor out (trivial) crush_destroy_rule()
authorSage Weil <sage@inktank.com>
Wed, 30 Jan 2013 08:50:21 +0000 (00:50 -0800)
committerSage Weil <sage@inktank.com>
Tue, 5 Feb 2013 22:31:13 +0000 (14:31 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/crush.c
src/crush/crush.h

index 19a765228e9bbc44a8403c235c405e0581a6ed02..1e83eb866bb77217166fc8c38db34fd584a6c37e 100644 (file)
@@ -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)
 {
index 9fd37e9e516ee5da205960c33625b0f78ec8fce7..82d032879d9407b56ae51f774b494d1f6e728912 100644 (file)
@@ -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)