]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use erasure code profile when building the PGBackend
authorLoic Dachary <loic@dachary.org>
Sun, 16 Mar 2014 15:13:17 +0000 (16:13 +0100)
committerLoic Dachary <loic@dachary.org>
Mon, 17 Mar 2014 23:23:42 +0000 (00:23 +0100)
The PGBackend::build_pg_backend() prototype is modified to add an
OSDMapRef which is used to get the profile stored in the pg_pool_t
and pass it to the erasure code plugin.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/osd/PGBackend.cc
src/osd/PGBackend.h
src/osd/ReplicatedPG.cc

index b93cd51fa923ae10ac74cd965a07569e5bdd2efd..dad17f9cd2619f9efa12d1df49b4519ea734212f 100644 (file)
@@ -268,6 +268,7 @@ void PGBackend::trim_stashed_object(
 
 PGBackend *PGBackend::build_pg_backend(
   const pg_pool_t &pool,
+  const OSDMapRef curmap,
   Listener *l,
   coll_t coll,
   coll_t temp_coll,
@@ -280,11 +281,12 @@ PGBackend *PGBackend::build_pg_backend(
   }
   case pg_pool_t::TYPE_ERASURE: {
     ErasureCodeInterfaceRef ec_impl;
-    assert(pool.properties.count("erasure-code-plugin"));
+    const map<string,string> &profile = curmap->get_erasure_code_profile(pool.erasure_code_profile);
+    assert(profile.count("plugin"));
     stringstream ss;
     ceph::ErasureCodePluginRegistry::instance().factory(
-      pool.properties.find("erasure-code-plugin")->second,
-      pool.properties,
+      profile.find("plugin")->second,
+      profile,
       &ec_impl,
       ss);
     assert(ec_impl);
index 80afbe963fd1c8a98f968802e9f371322def682c..f3dc0ad970c5c92f99a4d8fd42aab50464ede884 100644 (file)
 
    static PGBackend *build_pg_backend(
      const pg_pool_t &pool,
+     const OSDMapRef curmap,
      Listener *l,
      coll_t coll,
      coll_t temp_coll,
index 7d576d6cef01a5eb70cff49b2fbda27393f4ff93..397c31c550df4c50144d1159ea0d653dd6c5cff3 100644 (file)
@@ -1033,7 +1033,7 @@ ReplicatedPG::ReplicatedPG(OSDService *o, OSDMapRef curmap,
   PG(o, curmap, _pool, p, oid, ioid),
   pgbackend(
     PGBackend::build_pg_backend(
-      _pool.info, this, coll_t(p), coll_t::make_temp_coll(p), o->store, cct)),
+      _pool.info, curmap, this, coll_t(p), coll_t::make_temp_coll(p), o->store, cct)),
   snapset_contexts_lock("ReplicatedPG::snapset_contexts"),
   temp_seq(0),
   snap_trimmer_machine(this)