]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: associate a CollectionHandle& with PGBackend
authorSage Weil <sage@redhat.com>
Mon, 18 Jan 2016 17:43:11 +0000 (12:43 -0500)
committerSage Weil <sage@redhat.com>
Wed, 27 Jan 2016 19:34:51 +0000 (14:34 -0500)
Make this a ref to the PG's handle because the backend is
constructed before the handle is opened.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ECBackend.cc
src/osd/ECBackend.h
src/osd/PGBackend.cc
src/osd/PGBackend.h
src/osd/ReplicatedBackend.cc
src/osd/ReplicatedBackend.h
src/osd/ReplicatedPG.cc

index dadfeaa0b71475de85093b5ad066e5a1b413bd7f..f1bcd85f6f98308aa863b17a1440d68d646ac97e 100644 (file)
@@ -171,11 +171,12 @@ void ECBackend::RecoveryOp::dump(Formatter *f) const
 ECBackend::ECBackend(
   PGBackend::Listener *pg,
   coll_t coll,
+  ObjectStore::CollectionHandle &ch,
   ObjectStore *store,
   CephContext *cct,
   ErasureCodeInterfaceRef ec_impl,
   uint64_t stripe_width)
-  : PGBackend(pg, store, coll),
+  : PGBackend(pg, store, coll, ch),
     cct(cct),
     ec_impl(ec_impl),
     sinfo(ec_impl->get_data_chunk_count(), stripe_width) {
index bb064f8496512f754061df1ba434b11312f3b8c1..2f7b3b7cdfe4bdc1f571d864e757d9232106ea7c 100644 (file)
@@ -466,6 +466,7 @@ public:
   ECBackend(
     PGBackend::Listener *pg,
     coll_t coll,
+    ObjectStore::CollectionHandle &ch,
     ObjectStore *store,
     CephContext *cct,
     ErasureCodeInterfaceRef ec_impl,
index 10bc74d945944b242fc36a297b3c4dee8070d688..cc04ac8ce8fa8b6e397cd4c48b3c2f238be2646f 100644 (file)
@@ -274,12 +274,13 @@ PGBackend *PGBackend::build_pg_backend(
   const OSDMapRef curmap,
   Listener *l,
   coll_t coll,
+  ObjectStore::CollectionHandle &ch,
   ObjectStore *store,
   CephContext *cct)
 {
   switch (pool.type) {
   case pg_pool_t::TYPE_REPLICATED: {
-    return new ReplicatedBackend(l, coll, store, cct);
+    return new ReplicatedBackend(l, coll, ch, store, cct);
   }
   case pg_pool_t::TYPE_ERASURE: {
     ErasureCodeInterfaceRef ec_impl;
index 1e410c76d9d3c5cb7e157bdc74f7e59f852dde51..e995f1ac38175856c828d40998a5144092b93a29 100644 (file)
@@ -43,6 +43,7 @@
  protected:
    ObjectStore *store;
    const coll_t coll;
+   ObjectStore::CollectionHandle &ch;
  public:       
    /**
     * Provides interfaces for PGBackend callbacks
    };
    Listener *parent;
    Listener *get_parent() const { return parent; }
-   PGBackend(Listener *l, ObjectStore *store, coll_t coll) :
+   PGBackend(Listener *l, ObjectStore *store, coll_t coll,
+            ObjectStore::CollectionHandle &ch) :
      store(store),
      coll(coll),
+     ch(ch),
      parent(l) {}
    bool is_primary() const { return get_parent()->pgb_is_primary(); }
    OSDMapRef get_osdmap() const { return get_parent()->pgb_get_osdmap(); }
      const OSDMapRef curmap,
      Listener *l,
      coll_t coll,
+     ObjectStore::CollectionHandle &ch,
      ObjectStore *store,
      CephContext *cct);
  };
index 1ffa50decf4097ab84db44326d3da5f5090e30db..72055dec068fc75b4d5597182a0e219f89c99d6e 100644 (file)
@@ -62,9 +62,10 @@ static void log_subop_stats(
 ReplicatedBackend::ReplicatedBackend(
   PGBackend::Listener *pg,
   coll_t coll,
+  ObjectStore::CollectionHandle &c,
   ObjectStore *store,
   CephContext *cct) :
-  PGBackend(pg, store, coll),
+  PGBackend(pg, store, coll, c),
   cct(cct) {}
 
 void ReplicatedBackend::run_recovery_op(
index 7a1b72aeb963e9545d70fb4e3c11d3edbbd2a410..4858fcd8cf7e27ace77bc78df5acd86497052285 100644 (file)
@@ -33,6 +33,7 @@ public:
   ReplicatedBackend(
     PGBackend::Listener *pg,
     coll_t coll,
+    ObjectStore::CollectionHandle &ch,
     ObjectStore *store,
     CephContext *cct);
 
index 4d5c94db46b57490908c53164b53eaa2ed7d821e..e3e9e520ecf00ed52d944971be711b10b952a6d8 100644 (file)
@@ -1352,7 +1352,7 @@ ReplicatedPG::ReplicatedPG(OSDService *o, OSDMapRef curmap,
   PG(o, curmap, _pool, p),
   pgbackend(
     PGBackend::build_pg_backend(
-      _pool.info, curmap, this, coll_t(p), o->store, cct)),
+      _pool.info, curmap, this, coll_t(p), ch, o->store, cct)),
   object_contexts(o->cct, g_conf->osd_pg_object_context_cache_count),
   snapset_contexts_lock("ReplicatedPG::snapset_contexts"),
   backfills_in_flight(hobject_t::Comparator(true)),