]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't need to pass object names via ctor
authorSage Weil <sage@redhat.com>
Thu, 20 Nov 2014 00:12:28 +0000 (16:12 -0800)
committerSage Weil <sage@redhat.com>
Wed, 17 Dec 2014 01:07:56 +0000 (17:07 -0800)
Calculate biginfo on the fly.

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

index bd4d3374aa7f75fb7269c83047f8761a19b85cd6..5eea61ac46a8984ad2728684bc90435e714ba632 100644 (file)
@@ -2509,11 +2509,9 @@ PG* OSD::_make_pg(
 
   // create
   PG *pg;
-  hobject_t logoid = make_pg_log_oid(pgid);
-  hobject_t infooid = make_pg_biginfo_oid(pgid);
   if (createmap->get_pg_type(pgid.pgid) == pg_pool_t::TYPE_REPLICATED ||
       createmap->get_pg_type(pgid.pgid) == pg_pool_t::TYPE_ERASURE)
-    pg = new ReplicatedPG(&service, createmap, pool, pgid, logoid, infooid);
+    pg = new ReplicatedPG(&service, createmap, pool, pgid);
   else 
     assert(0);
 
index 5f25c2a3e7d27b996a475b1dd02f1b6aa669799c..e495d1b680b82b78dacc33d3d4f022fb16d0e936 100644 (file)
@@ -160,8 +160,7 @@ void PGPool::update(OSDMapRef map)
 }
 
 PG::PG(OSDService *o, OSDMapRef curmap,
-       const PGPool &_pool, spg_t p, const hobject_t& loid,
-       const hobject_t& ioid) :
+       const PGPool &_pool, spg_t p) :
   osd(o),
   cct(o->cct),
   osdriver(osd->store, coll_t(), OSD::make_snapmapper_oid()),
@@ -183,7 +182,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   info_struct_v(0),
   coll(p), pg_log(cct),
   pgmeta_oid(p.make_pgmeta_oid()),
-  log_oid(loid), biginfo_oid(ioid),
+  log_oid(OSD::make_pg_log_oid(p)),
   missing_loc(this),
   recovery_item(this), scrub_item(this), scrub_finalize_item(this), snap_trim_item(this), stat_queue_item(this),
   recovery_ops_active(0),
@@ -2890,6 +2889,8 @@ int PG::read_info(
 
 void PG::read_state(ObjectStore *store, bufferlist &bl)
 {
+  hobject_t biginfo_oid(OSD::make_pg_biginfo_oid(pg_id));
+
   int r = read_info(store, coll, bl, info, past_intervals, biginfo_oid,
     osd->infos_oid, snap_collections, info_struct_v);
   assert(r >= 0);
index e4bfb35cbf7318f23801d72993d21495f4c9dcd4..4d0a8df4e3cd533a98ec640b283471e99150abc1 100644 (file)
@@ -301,7 +301,6 @@ public:
   }
   ghobject_t    pgmeta_oid;
   hobject_t    log_oid;
-  hobject_t    biginfo_oid;
 
   class MissingLoc {
     map<hobject_t, pg_missing_t::item> needs_recovery_map;
@@ -1988,7 +1987,7 @@ public:
 
  public:
   PG(OSDService *o, OSDMapRef curmap,
-     const PGPool &pool, spg_t p, const hobject_t& loid, const hobject_t& ioid);
+     const PGPool &pool, spg_t p);
   virtual ~PG();
 
  private:
index a4e1aa6f1bdb81b60556afd33a1c683f2f96d926..09158c940b05e142df04ccaa6f7265f2aa678f78 100644 (file)
@@ -1226,9 +1226,8 @@ void ReplicatedPG::calc_trim_to()
 }
 
 ReplicatedPG::ReplicatedPG(OSDService *o, OSDMapRef curmap,
-                          const PGPool &_pool, spg_t p, const hobject_t& oid,
-                          const hobject_t& ioid) :
-  PG(o, curmap, _pool, p, oid, ioid),
+                          const PGPool &_pool, spg_t p) :
+  PG(o, curmap, _pool, p),
   pgbackend(
     PGBackend::build_pg_backend(
       _pool.info, curmap, this, coll_t(p), coll_t::make_temp_coll(p), o->store, cct)),
index 51636cde49a8491d32f9a34fc5c14c1f540d5da5..c66a9b84e365dc03ec2a1fec8fea1c5cc1121b3f 100644 (file)
@@ -1282,8 +1282,7 @@ protected:
 
 public:
   ReplicatedPG(OSDService *o, OSDMapRef curmap,
-              const PGPool &_pool, spg_t p, const hobject_t& oid,
-              const hobject_t& ioid);
+              const PGPool &_pool, spg_t p);
   ~ReplicatedPG() {}
 
   int do_command(cmdmap_t cmdmap, ostream& ss, bufferlist& idata,