Merge git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
[cascardo/linux.git] / net / ceph / crush / mapper.c
index 11cf352..d7edc24 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/crush/crush.h>
 #include <linux/crush/hash.h>
+#include <linux/crush/mapper.h>
 
 /*
  * Implement the core CRUSH mapping algorithm.
@@ -68,8 +69,8 @@ int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size
 static int bucket_perm_choose(struct crush_bucket *bucket,
                              int x, int r)
 {
-       unsigned pr = r % bucket->size;
-       unsigned i, s;
+       unsigned int pr = r % bucket->size;
+       unsigned int i, s;
 
        /* start a new permutation if @x has changed */
        if (bucket->perm_x != (__u32)x || bucket->perm_n == 0) {
@@ -100,13 +101,13 @@ static int bucket_perm_choose(struct crush_bucket *bucket,
        for (i = 0; i < bucket->perm_n; i++)
                dprintk(" perm_choose have %d: %d\n", i, bucket->perm[i]);
        while (bucket->perm_n <= pr) {
-               unsigned p = bucket->perm_n;
+               unsigned int p = bucket->perm_n;
                /* no point in swapping the final entry */
                if (p < bucket->size - 1) {
                        i = crush_hash32_3(bucket->hash, x, bucket->id, p) %
                                (bucket->size - p);
                        if (i) {
-                               unsigned t = bucket->perm[p + i];
+                               unsigned int t = bucket->perm[p + i];
                                bucket->perm[p + i] = bucket->perm[p];
                                bucket->perm[p] = t;
                        }