int size = (sizeof(struct crush_choose_arg) * map->max_buckets +
sizeof(struct crush_weight_set) * bucket_count * num_positions +
sizeof(__u32) * sum_bucket_size * num_positions + // weights
- sizeof(__u32) * sum_bucket_size); // ids
+ sizeof(__s32) * sum_bucket_size); // ids
char *space = malloc(size);
struct crush_choose_arg *arg = (struct crush_choose_arg *)space;
struct crush_weight_set *weight_set = (struct crush_weight_set *)(arg + map->max_buckets);
__u32 *weights = (__u32 *)(weight_set + bucket_count * num_positions);
char *weight_set_ends = (char*)weights;
- int *ids = (int *)(weights + sum_bucket_size * num_positions);
+ __s32 *ids = (__s32 *)(weights + sum_bucket_size * num_positions);
char *weights_end = (char *)ids;
char *ids_end = (char *)(ids + sum_bucket_size);
BUG_ON(space + size != ids_end);
arg[b].weight_set_size = num_positions;
weight_set += position;
- memcpy(ids, bucket->h.items, sizeof(int) * bucket->h.size);
+ memcpy(ids, bucket->h.items, sizeof(__s32) * bucket->h.size);
arg[b].ids = ids;
arg[b].ids_size = bucket->h.size;
ids += bucket->h.size;