aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crush/crush.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-07 15:38:35 -0700
committerSage Weil <sage@inktank.com>2012-05-07 15:38:35 -0700
commit8b12d47b80c7a34dffdd98244d99316db490ec58 (patch)
treefb97986bc823ebcce487d573fc83ee3b1c8f5f98 /net/ceph/crush/crush.c
parentceph: refactor SETLAYOUT and SETDIRLAYOUT ioctl checks into common helper (diff)
downloadlinux-dev-8b12d47b80c7a34dffdd98244d99316db490ec58.tar.xz
linux-dev-8b12d47b80c7a34dffdd98244d99316db490ec58.zip
crush: clean up types, const-ness
Move various types from int -> __u32 (or similar), and add const as appropriate. This reflects changes that have been present in the userland implementation for some time. Reviewed-by: Alex Elder <elder@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/crush/crush.c')
-rw-r--r--net/ceph/crush/crush.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/crush/crush.c b/net/ceph/crush/crush.c
index d6ebb13a18a4..8dd19a0deedc 100644
--- a/net/ceph/crush/crush.c
+++ b/net/ceph/crush/crush.c
@@ -26,9 +26,9 @@ const char *crush_bucket_alg_name(int alg)
* @b: bucket pointer
* @p: item index in bucket
*/
-int crush_get_bucket_item_weight(struct crush_bucket *b, int p)
+int crush_get_bucket_item_weight(const struct crush_bucket *b, int p)
{
- if (p >= b->size)
+ if ((__u32)p >= b->size)
return 0;
switch (b->alg) {
@@ -124,10 +124,9 @@ void crush_destroy_bucket(struct crush_bucket *b)
*/
void crush_destroy(struct crush_map *map)
{
- int b;
-
/* buckets */
if (map->buckets) {
+ __s32 b;
for (b = 0; b < map->max_buckets; b++) {
if (map->buckets[b] == NULL)
continue;
@@ -138,6 +137,7 @@ void crush_destroy(struct crush_map *map)
/* rules */
if (map->rules) {
+ __u32 b;
for (b = 0; b < map->max_rules; b++)
kfree(map->rules[b]);
kfree(map->rules);