From 79a365ac76d5f5bd71b893ae2c1ccad94eb91cef Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 1 Oct 2012 17:05:48 -0700 Subject: [PATCH] librbd: populate struct ceph_file_layout for image Signed-off-by: Sage Weil --- src/librbd/ImageCtx.cc | 6 ++++++ src/librbd/ImageCtx.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index e223645e75d2f..1fd9edf3644a9 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -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; } diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h index 47e4c37380aba..616da8ff6f7b4 100644 --- a/src/librbd/ImageCtx.h +++ b/src/librbd/ImageCtx.h @@ -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; -- 2.39.5