]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: populate struct ceph_file_layout for image
authorSage Weil <sage@inktank.com>
Tue, 2 Oct 2012 00:05:48 +0000 (17:05 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Oct 2012 22:34:03 +0000 (15:34 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h

index e223645e75d2fcda7bd8b2d4c4a6678b6f6ce449..1fd9edf3644a96f88b77343c4f864d897e58a34b 100644 (file)
@@ -141,6 +141,12 @@ namespace librbd {
       stripe_count = 1;
     }
 
+    // initialize layout
+    memset(&layout, 0, sizeof(layout));
+    layout.fl_stripe_unit = stripe_unit;
+    layout.fl_stripe_count = stripe_count;
+    layout.fl_object_size = 1ull << order;
+    layout.fl_pg_pool = data_ctx.get_id();  // FIXME: pool id overflow?
     return 0;
   }
 
index 47e4c37380aba48e41b8bd1f1f657fb6e6b7a908..616da8ff6f7b4eae1453ec8a527f30adcd1e3b17 100644 (file)
@@ -78,6 +78,8 @@ namespace librbd {
     ImageCtx *parent;
     uint64_t stripe_unit, stripe_count;
 
+    ceph_file_layout layout;
+
     ObjectCacher *object_cacher;
     LibrbdWriteback *writeback_handler;
     ObjectCacher::ObjectSet *object_set;