0001
0002 #ifndef CEPH_CRUSH_MAPPER_H
0003 #define CEPH_CRUSH_MAPPER_H
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "crush.h"
0013
0014 extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size);
0015 int crush_do_rule(const struct crush_map *map,
0016 int ruleno, int x, int *result, int result_max,
0017 const __u32 *weight, int weight_max,
0018 void *cwin, const struct crush_choose_arg *choose_args);
0019
0020
0021
0022
0023
0024
0025
0026 static inline size_t crush_work_size(const struct crush_map *map,
0027 int result_max)
0028 {
0029 return map->working_size + result_max * 3 * sizeof(__u32);
0030 }
0031
0032 void crush_init_workspace(const struct crush_map *map, void *v);
0033
0034 #endif