]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: destroy and wrapper bugfixes
authorSage Weil <sage@newdream.net>
Wed, 19 Mar 2008 20:45:19 +0000 (13:45 -0700)
committerSage Weil <sage@newdream.net>
Thu, 20 Mar 2008 01:19:36 +0000 (18:19 -0700)
src/crush/CrushWrapper.h
src/crush/crush.c
src/crush/sample.txt

index 8c4e99c0536cdd1c5f3a99f18c045cda6b524f10..ed337f0a4fcb98632b3043d9c22bcea806726e19 100644 (file)
@@ -46,7 +46,7 @@ private:
   }
   
 public:
-  CrushWrapper() : crush(0) {}
+  CrushWrapper() : crush(0), have_rmaps(false) {}
   ~CrushWrapper() {
     if (crush) crush_destroy(crush);
   }  
@@ -265,7 +265,6 @@ public:
   int add_bucket(int bucketno, int alg, int type, int size,
                 int *items, int *weights) {
     crush_bucket *b = crush_make_bucket(alg, type, size, items, weights);
-
     return crush_add_bucket(crush, bucketno, b);
   }
   
index f55663a34ff487e278329ab7fa0c2cee15604b54..843f91da6189b1050eb12c1df0a858b82a8d6290 100644 (file)
@@ -64,7 +64,7 @@ void crush_destroy(struct crush_map *map)
        if (map->buckets) {
                for (b=0; b<map->max_buckets; b++) {
                        if (map->buckets[b] == 0) continue;
-                       switch (map->buckets[b]->type) {
+                       switch (map->buckets[b]->alg) {
                        case CRUSH_BUCKET_UNIFORM:
                                crush_destroy_bucket_uniform((struct crush_bucket_uniform*)map->buckets[b]);
                                break;
index 2400491f8440fa39c696653e0b8646d456f2ecb5..99b2040280211db48ddc7256e39ca2b107a14d03 100644 (file)
                <item osd001/>
                <item osd002/>
                <item osd003/>
-               <item osd004/>
+               <item osd004>
+                     weight 600
+               </item>
        </cab>
        
-       <pool newlayout>
-               <item satapool>
-                       weight 1.0
-               </item>
-               <item fcpool>
-                       weight 3.0
-               </item>
-       </pool>
+#      <pool newlayout>
+#              <item satapool>
+#                      weight 1.0
+#              </item>
+#              <item fcpool>
+#                      weight 3.0
+#              </item>
+#      </pool>
 </buckets>
 
 <devices>