Go to the documentation of this file.00001 #ifndef _CRUSH_BUILDER_H
00002 #define _CRUSH_BUILDER_H
00003
00004 #include "crush.h"
00005
00006
00007 extern struct crush_map *crush_create();
00008 extern void crush_finalize(struct crush_map *map);
00009
00010
00011 extern struct crush_rule *crush_make_rule(int len, int pool, int type, int minsize, int maxsize);
00012 extern void crush_rule_set_step(struct crush_rule *rule, int pos, int op, int arg1, int arg2);
00013 extern int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno);
00014
00015
00016 extern int crush_get_next_bucket_id(struct crush_map *map);
00017 extern int crush_add_bucket(struct crush_map *map,
00018 int bucketno,
00019 struct crush_bucket *bucket);
00020
00021 struct crush_bucket *crush_make_bucket(int alg, int hash, int type, int size, int *items, int *weights);
00022
00023 struct crush_bucket_uniform *
00024 crush_make_uniform_bucket(int hash, int type, int size,
00025 int *items,
00026 int item_weight);
00027 struct crush_bucket_list*
00028 crush_make_list_bucket(int hash, int type, int size,
00029 int *items,
00030 int *weights);
00031 struct crush_bucket_tree*
00032 crush_make_tree_bucket(int hash, int type, int size,
00033 int *items,
00034 int *weights);
00035 struct crush_bucket_straw *
00036 crush_make_straw_bucket(int hash, int type, int size,
00037 int *items,
00038 int *weights);
00039
00040 #endif