OSDN Git Service

crush: factor out (trivial) crush_destroy_rule()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 24 Dec 2013 19:19:24 +0000 (21:19 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 31 Dec 2013 18:32:11 +0000 (20:32 +0200)
Reflects ceph.git commit 43a01c9973c4b83f2eaa98be87429941a227ddde.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
include/linux/crush/crush.h
net/ceph/crush/crush.c

index 6a1101f..09561a0 100644 (file)
@@ -174,6 +174,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)
index 0896132..16bc199 100644 (file)
@@ -116,11 +116,14 @@ 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);
        }
 
        kfree(map);
 }
 
-
+void crush_destroy_rule(struct crush_rule *rule)
+{
+       kfree(rule);
+}