aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/crush/crush.h11
-rw-r--r--net/ceph/crush/crush.c25
-rw-r--r--net/ceph/osdmap.c7
3 files changed, 0 insertions, 43 deletions
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 3f50369a50e8..158a4d25ca83 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -151,16 +151,6 @@ struct crush_map {
151 struct crush_bucket **buckets; 151 struct crush_bucket **buckets;
152 struct crush_rule **rules; 152 struct crush_rule **rules;
153 153
154 /*
155 * Parent pointers to identify the parent bucket a device or
156 * bucket in the hierarchy. If an item appears more than
157 * once, this is the _last_ time it appeared (where buckets
158 * are processed in bucket id order, from -1 on down to
159 * -max_buckets.
160 */
161 __u32 *bucket_parents;
162 __u32 *device_parents;
163
164 __s32 max_buckets; 154 __s32 max_buckets;
165 __u32 max_rules; 155 __u32 max_rules;
166 __s32 max_devices; 156 __s32 max_devices;
@@ -169,7 +159,6 @@ struct crush_map {
169 159
170/* crush.c */ 160/* crush.c */
171extern int crush_get_bucket_item_weight(const struct crush_bucket *b, int pos); 161extern int crush_get_bucket_item_weight(const struct crush_bucket *b, int pos);
172extern void crush_calc_parents(struct crush_map *map);
173extern void crush_destroy_bucket_uniform(struct crush_bucket_uniform *b); 162extern void crush_destroy_bucket_uniform(struct crush_bucket_uniform *b);
174extern void crush_destroy_bucket_list(struct crush_bucket_list *b); 163extern void crush_destroy_bucket_list(struct crush_bucket_list *b);
175extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); 164extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b);
diff --git a/net/ceph/crush/crush.c b/net/ceph/crush/crush.c
index 8dd19a0deedc..2160791acf03 100644
--- a/net/ceph/crush/crush.c
+++ b/net/ceph/crush/crush.c
@@ -46,29 +46,6 @@ int crush_get_bucket_item_weight(const struct crush_bucket *b, int p)
46 return 0; 46 return 0;
47} 47}
48 48
49/**
50 * crush_calc_parents - Calculate parent vectors for the given crush map.
51 * @map: crush_map pointer
52 */
53void crush_calc_parents(struct crush_map *map)
54{
55 int i, b, c;
56
57 for (b = 0; b < map->max_buckets; b++) {
58 if (map->buckets[b] == NULL)
59 continue;
60 for (i = 0; i < map->buckets[b]->size; i++) {
61 c = map->buckets[b]->items[i];
62 BUG_ON(c >= map->max_devices ||
63 c < -map->max_buckets);
64 if (c >= 0)
65 map->device_parents[c] = map->buckets[b]->id;
66 else
67 map->bucket_parents[-1-c] = map->buckets[b]->id;
68 }
69 }
70}
71
72void crush_destroy_bucket_uniform(struct crush_bucket_uniform *b) 49void crush_destroy_bucket_uniform(struct crush_bucket_uniform *b)
73{ 50{
74 kfree(b->h.perm); 51 kfree(b->h.perm);
@@ -143,8 +120,6 @@ void crush_destroy(struct crush_map *map)
143 kfree(map->rules); 120 kfree(map->rules);
144 } 121 }
145 122
146 kfree(map->bucket_parents);
147 kfree(map->device_parents);
148 kfree(map); 123 kfree(map);
149} 124}
150 125
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 9dda36f7aa9d..dac448ba68e4 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -161,13 +161,6 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
161 c->max_rules = ceph_decode_32(p); 161 c->max_rules = ceph_decode_32(p);
162 c->max_devices = ceph_decode_32(p); 162 c->max_devices = ceph_decode_32(p);
163 163
164 c->device_parents = kcalloc(c->max_devices, sizeof(u32), GFP_NOFS);
165 if (c->device_parents == NULL)
166 goto badmem;
167 c->bucket_parents = kcalloc(c->max_buckets, sizeof(u32), GFP_NOFS);
168 if (c->bucket_parents == NULL)
169 goto badmem;
170
171 c->buckets = kcalloc(c->max_buckets, sizeof(*c->buckets), GFP_NOFS); 164 c->buckets = kcalloc(c->max_buckets, sizeof(*c->buckets), GFP_NOFS);
172 if (c->buckets == NULL) 165 if (c->buckets == NULL)
173 goto badmem; 166 goto badmem;