Lines Matching defs:map
37 * @map: the crush_map
42 int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size)
46 for (i = 0; i < map->max_rules; i++) {
47 if (map->rules[i] &&
48 map->rules[i]->mask.ruleset == ruleset &&
49 map->rules[i]->mask.type == type &&
50 map->rules[i]->mask.min_size <= size &&
51 map->rules[i]->mask.max_size >= size)
413 static int is_out(const struct crush_map *map,
431 * @map: the crush_map
449 static int crush_choose_firstn(const struct crush_map *map,
519 if (item >= map->max_devices) {
527 itemtype = map->buckets[-1-item]->type;
535 (-1-item) >= map->max_buckets) {
540 in = map->buckets[-1-item];
562 map,
564 map->buckets[-1-item],
588 reject = is_out(map, weight,
629 if (map->choose_tries && ftotal <= map->choose_total_tries)
630 map->choose_tries[ftotal]++;
643 static void crush_choose_indep(const struct crush_map *map,
730 if (item >= map->max_devices) {
741 itemtype = map->buckets[-1-item]->type;
749 (-1-item) >= map->max_buckets) {
758 in = map->buckets[-1-item];
776 map,
778 map->buckets[-1-item],
797 is_out(map, weight, weight_max, item, x))
816 if (map->choose_tries && ftotal <= map->choose_total_tries)
817 map->choose_tries[ftotal]++;
841 * map has not changed. If the map /has/ changed, you must make sure
848 void crush_init_workspace(const struct crush_map *map, void *v)
863 v += map->max_buckets * sizeof(struct crush_work_bucket *);
864 for (b = 0; b < map->max_buckets; ++b) {
865 if (!map->buckets[b])
869 switch (map->buckets[b]->alg) {
877 v += map->buckets[b]->size * sizeof(__u32);
879 BUG_ON(v - (void *)w != map->working_size);
884 * @map: the crush_map
889 * @weight: weight vector (for map leaves)
894 int crush_do_rule(const struct crush_map *map,
901 int *a = cwin + map->working_size;
919 int choose_tries = map->choose_total_tries + 1;
925 int choose_local_retries = map->choose_local_tries;
926 int choose_local_fallback_retries = map->choose_local_fallback_tries;
928 int vary_r = map->chooseleaf_vary_r;
929 int stable = map->chooseleaf_stable;
931 if ((__u32)ruleno >= map->max_rules) {
936 rule = map->rules[ruleno];
946 curstep->arg1 < map->max_devices) ||
948 -1-curstep->arg1 < map->max_buckets &&
949 map->buckets[-1-curstep->arg1])) {
1016 if (bno < 0 || bno >= map->max_buckets) {
1026 else if (map->chooseleaf_descend_once)
1031 map,
1033 map->buckets[bno],
1053 map,
1055 map->buckets[bno],