函数原型:

 1 /**
 2  * crush_do_rule - calculate a mapping with the given input and rule
 3  * @map: the crush_map
 4  * @ruleno: the rule id
 5  * @x: hash input                             // hash,即对象名称hash与pgnumber mod后的值再与pool id进行hash的结果
 6  * @result: pointer to result vector
 7  * @result_max: maximum result size
 8  * @weight: weight vector (for map leaves)    
 9  * @weight_max: size of weight vector
10  * @cwin: Pointer to at least map->working_size bytes of memory or NULL.
11  */
12 int crush_do_rule(const struct crush_map *map,
13           int ruleno, int x, int *result, int result_max,
14           const __u32 *weight, int weight_max,
15           void *cwin)

 

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄