]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crush/mapper.c
update sources to v12.1.2
[ceph.git] / ceph / src / crush / mapper.c
index 321e7a7d549cf88ae74144e03ff39505f5760d77..e15039ed944b9b880647e73d8cafd38d9f6c4a46 100644 (file)
@@ -304,16 +304,15 @@ static inline __u32 *get_choose_arg_weights(const struct crush_bucket_straw2 *bu
                                             int position)
 {
   if ((arg == NULL) ||
-      (arg->weight_set == NULL) ||
-      (arg->weight_set_size == 0))
+      (arg->weight_set == NULL))
     return bucket->item_weights;
   if (position >= arg->weight_set_size)
     position = arg->weight_set_size - 1;
   return arg->weight_set[position].weights;
 }
 
-static inline int *get_choose_arg_ids(const struct crush_bucket_straw2 *bucket,
-                                        const struct crush_choose_arg *arg)
+static inline __s32 *get_choose_arg_ids(const struct crush_bucket_straw2 *bucket,
+                                       const struct crush_choose_arg *arg)
 {
   if ((arg == NULL) || (arg->ids == NULL))
     return bucket->h.items;
@@ -328,7 +327,7 @@ static int bucket_straw2_choose(const struct crush_bucket_straw2 *bucket,
        unsigned int u;
        __s64 ln, draw, high_draw = 0;
         __u32 *weights = get_choose_arg_weights(bucket, arg, position);
-        int *ids = get_choose_arg_ids(bucket, arg);
+        __s32 *ids = get_choose_arg_ids(bucket, arg);
        for (i = 0; i < bucket->h.size; i++) {
                 dprintk("weight 0x%x item %d\n", weights[i], ids[i]);
                if (weights[i]) {