diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 23:41:33 +0000 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 23:41:33 +0000 |
commit | 4551ae0a24bba06972247a80f721fc21f6b2b758 (patch) | |
tree | 7e17b819ba34f73988d384161335ebe5729897ad /net/ceph | |
parent | e2c236f0a42fbb9e6a9528f8436f348218ffee96 (diff) | |
parent | 384703b8e6cd4c8ef08512e596024e028c91c339 (diff) | |
download | op-kernel-dev-4551ae0a24bba06972247a80f721fc21f6b2b758.zip op-kernel-dev-4551ae0a24bba06972247a80f721fc21f6b2b758.tar.gz |
Merge branch 'v3.2-rc6' into next/drivers
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/crush/mapper.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 42599e3..3a94eae 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -477,7 +477,6 @@ int crush_do_rule(struct crush_map *map, int i, j; int numrep; int firstn; - int rc = -1; BUG_ON(ruleno >= map->max_rules); @@ -491,23 +490,18 @@ int crush_do_rule(struct crush_map *map, * that this may or may not correspond to the specific types * referenced by the crush rule. */ - if (force >= 0) { - if (force >= map->max_devices || - map->device_parents[force] == 0) { - /*dprintk("CRUSH: forcefed device dne\n");*/ - rc = -1; /* force fed device dne */ - goto out; - } - if (!is_out(map, weight, force, x)) { - while (1) { - force_context[++force_pos] = force; - if (force >= 0) - force = map->device_parents[force]; - else - force = map->bucket_parents[-1-force]; - if (force == 0) - break; - } + if (force >= 0 && + force < map->max_devices && + map->device_parents[force] != 0 && + !is_out(map, weight, force, x)) { + while (1) { + force_context[++force_pos] = force; + if (force >= 0) + force = map->device_parents[force]; + else + force = map->bucket_parents[-1-force]; + if (force == 0) + break; } } @@ -600,10 +594,7 @@ int crush_do_rule(struct crush_map *map, BUG_ON(1); } } - rc = result_len; - -out: - return rc; + return result_len; } |