]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: zero weight items get 0 length straws
authorSage Weil <sage@newdream.net>
Wed, 7 Oct 2009 18:54:20 +0000 (11:54 -0700)
committerSage Weil <sage@newdream.net>
Wed, 7 Oct 2009 18:55:49 +0000 (11:55 -0700)
src/crush/builder.c

index 7ac398db44ff17c65a3e97a520a85efd652df2d0..a10f7a455efbb30708cff7e78b07b51e085084b5 100644 (file)
@@ -333,6 +333,13 @@ crush_make_straw_bucket(int type,
 
        i=0;
        while (i < size) {
+               /* zero weight items get 0 length straws! */
+               if (weights[reverse[i]] == 0) {
+                       bucket->straws[reverse[i]] = 0;
+                       i++;
+                       continue;
+               }
+
                /* set this item's straw */
                bucket->straws[reverse[i]] = straw * 0x10000;
                /*printf("item %d at %d weight %d straw %d (%lf)\n",