Ejemplo n.º 1
0
/**
 * crush_destroy - Destroy a crush_map
 * @map: crush_map pointer
 */
void crush_destroy(struct crush_map *map)
{
	int b;

	/* buckets */
	if (map->buckets) {
		for (b = 0; b < map->max_buckets; b++) {
			if (map->buckets[b] == NULL)
				continue;
			crush_destroy_bucket(map->buckets[b]);
		}
		kfree(map->buckets);
	}

	/* rules */
	if (map->rules) {
		for (b = 0; b < map->max_rules; b++)
			kfree(map->rules[b]);
		kfree(map->rules);
	}

	kfree(map->bucket_parents);
	kfree(map->device_parents);
	kfree(map);
}
Ejemplo n.º 2
0
/**
 * crush_destroy - Destroy a crush_map
 * @map: crush_map pointer
 */
void crush_destroy(struct crush_map *map)
{
    /* buckets */
    if (map->buckets)
    {
        __s32 b;
        for (b = 0; b < map->max_buckets; b++)
        {
            if (map->buckets[b] == NULL)
                continue;
            crush_destroy_bucket(map->buckets[b]);
        }
        kfree(map->buckets);
    }

    /* rules */
    if (map->rules)
    {
        __u32 b;
        for (b = 0; b < map->max_rules; b++)
            crush_destroy_rule(map->rules[b]);
        kfree(map->rules);
    }

#ifndef __KERNEL__
    kfree(map->choose_tries);
#endif
    kfree(map);
}
Ejemplo n.º 3
0
Archivo: builder.c Proyecto: CzBiX/ceph
int crush_remove_bucket(struct crush_map *map, struct crush_bucket *bucket)
{
	int pos = -1 - bucket->id;

	map->buckets[pos] = NULL;
	crush_destroy_bucket(bucket);
	return 0;
}
Ejemplo n.º 4
0
/**
 * crush_destroy - Destroy a crush_map
 * @map: crush_map pointer
 */
void crush_destroy(struct crush_map *map)
{
	/* buckets */
	if (map->buckets) {
		__s32 b;
		for (b = 0; b < map->max_buckets; b++) {
			if (map->buckets[b] == NULL)
				continue;
			crush_destroy_bucket(map->buckets[b]);
		}
		kfree(map->buckets);
	}

	/* rules */
	if (map->rules) {
		__u32 b;
		for (b = 0; b < map->max_rules; b++)
			crush_destroy_rule(map->rules[b]);
		kfree(map->rules);
	}

	kfree(map);
}