ceph/branches/ebofs/crush/builder.h
sageweil dc48f25847 branch for ebofs changes
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2100 29311d96-e01e-0410-9327-a35deaab8ce9
2007-11-21 00:32:00 +00:00

46 lines
1.0 KiB
C

#ifndef _CRUSH_BUILDER_H
#define _CRUSH_BUILDER_H
#include "crush.h"
#ifdef __cplusplus
extern "C" {
#endif
extern struct crush_map *crush_create();
extern void crush_finalize(struct crush_map *map);
/* rules */
extern struct crush_rule *crush_make_rule();
extern int crush_add_rule(struct crush_map *map,
int ruleno,
struct crush_rule *rule);
extern void crush_rule_add_step(struct crush_rule *rule, int op, int arg1, int arg2);
/* buckets */
extern int crush_add_bucket(struct crush_map *map,
struct crush_bucket *bucket);
struct crush_bucket_uniform *
crush_make_uniform_bucket(int type, int size,
int *items,
int item_weight);
struct crush_bucket_list*
crush_make_list_bucket(int type, int size,
int *items,
int *weights);
struct crush_bucket_tree*
crush_make_tree_bucket(int type, int size,
int *items, /* in leaf order */
int *weights);
struct crush_bucket_straw *
crush_make_straw_bucket(int type, int size,
int *items,
int *weights);
#ifdef __cplusplus
}
#endif
#endif