Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6 -2
+1
include/linux/crush/crush.h
··· 174 174 extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); 175 175 extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b); 176 176 extern void crush_destroy_bucket(struct crush_bucket *b); 177 + extern void crush_destroy_rule(struct crush_rule *r); 177 178 extern void crush_destroy(struct crush_map *map); 178 179 179 180 static inline int crush_calc_tree_node(int i)
+5 -2
net/ceph/crush/crush.c
··· 116 116 if (map->rules) { 117 117 __u32 b; 118 118 for (b = 0; b < map->max_rules; b++) 119 - kfree(map->rules[b]); 119 + crush_destroy_rule(map->rules[b]); 120 120 kfree(map->rules); 121 121 } 122 122 123 123 kfree(map); 124 124 } 125 125 126 - 126 + void crush_destroy_rule(struct crush_rule *rule) 127 + { 128 + kfree(rule); 129 + }