diff options
author | Ilya Dryomov <ilya.dryomov@inktank.com> | 2013-12-24 14:19:24 -0500 |
---|---|---|
committer | Ilya Dryomov <ilya.dryomov@inktank.com> | 2013-12-31 13:32:11 -0500 |
commit | bfb16d7d69f0272451ad85a6e50aab3c4262fbc0 (patch) | |
tree | 411212756451fde3e9e4e6d74d946f9e94ba2f16 | |
parent | b3b33b0e43323af4fb697f4378218d3c268d02cd (diff) |
crush: factor out (trivial) crush_destroy_rule()
Reflects ceph.git commit 43a01c9973c4b83f2eaa98be87429941a227ddde.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | include/linux/crush/crush.h | 1 | ||||
-rw-r--r-- | net/ceph/crush/crush.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 6a1101f24cfb..09561a04c127 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h | |||
@@ -174,6 +174,7 @@ extern void crush_destroy_bucket_list(struct crush_bucket_list *b); | |||
174 | extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); | 174 | extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); |
175 | extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b); | 175 | extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b); |
176 | extern void crush_destroy_bucket(struct crush_bucket *b); | 176 | extern void crush_destroy_bucket(struct crush_bucket *b); |
177 | extern void crush_destroy_rule(struct crush_rule *r); | ||
177 | extern void crush_destroy(struct crush_map *map); | 178 | extern void crush_destroy(struct crush_map *map); |
178 | 179 | ||
179 | static inline int crush_calc_tree_node(int i) | 180 | static inline int crush_calc_tree_node(int i) |
diff --git a/net/ceph/crush/crush.c b/net/ceph/crush/crush.c index 089613234f03..16bc199d9a62 100644 --- a/net/ceph/crush/crush.c +++ b/net/ceph/crush/crush.c | |||
@@ -116,11 +116,14 @@ void crush_destroy(struct crush_map *map) | |||
116 | if (map->rules) { | 116 | if (map->rules) { |
117 | __u32 b; | 117 | __u32 b; |
118 | for (b = 0; b < map->max_rules; b++) | 118 | for (b = 0; b < map->max_rules; b++) |
119 | kfree(map->rules[b]); | 119 | crush_destroy_rule(map->rules[b]); |
120 | kfree(map->rules); | 120 | kfree(map->rules); |
121 | } | 121 | } |
122 | 122 | ||
123 | kfree(map); | 123 | kfree(map); |
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | void crush_destroy_rule(struct crush_rule *rule) | |
127 | { | ||
128 | kfree(rule); | ||
129 | } | ||