The ring has some optimizations in get_more_nodes() so that it can
find handoffs that span all the regions/zones/et cetera and then stop
looking. The stopping is the important part.
Previously, it would quickly find a handoff in each unused region,
then spend way too long looking for more unused regions; the same was
true for zones, IPs, and so on. Thus, in commit 9cd7c6c, we started
counting regions and zones, then stopping when we found them all.
This count included all regions and zones in the ring, regardless of
whether or not there were actually any parts assigned or not. In rings
with an empty region, i.e. a region for which there are only
zero-weight devices, get_more_nodes() would be very slow.
This commit ignores devices with no assigned partitions when counting
regions, zones, and so forth, thus greatly speeding things up.
The output of get_more_nodes() is unchanged. This is purely an
optimization.
Closes-Bug: 1534303
Change-Id: I4a5c57205e87e1205d40fd5d9458d4114e524332