From: Sage Weil Date: Wed, 30 Jan 2013 08:50:21 +0000 (-0800) Subject: crush: factor out (trivial) crush_destroy_rule() X-Git-Tag: v0.58~141^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43a01c9973c4b83f2eaa98be87429941a227ddde;p=ceph.git crush: factor out (trivial) crush_destroy_rule() Signed-off-by: Sage Weil --- diff --git a/src/crush/crush.c b/src/crush/crush.c index 19a765228e9b..1e83eb866bb7 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 9fd37e9e516e..82d032879d94 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)