]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove localized pgs from pg_pool_t
authorSage Weil <sage.weil@dreamhost.com>
Fri, 20 Apr 2012 04:40:34 +0000 (21:40 -0700)
committerSage Weil <sage@newdream.net>
Mon, 23 Apr 2012 21:48:01 +0000 (14:48 -0700)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/OSDMap.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index e523869e53e578d6aa29b1a5649df8ffc81f88de..08ebd6e3627da5b7c9372d9cb0ed8b2482216ebb 100644 (file)
@@ -1101,8 +1101,6 @@ void OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
     pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
     pools[pool].pg_num = poolbase << pg_bits;
     pools[pool].pgp_num = poolbase << pgp_bits;
-    pools[pool].lpg_num = 0;
-    pools[pool].lpgp_num = 0;
     pools[pool].last_change = epoch;
     if (p->first == CEPH_DATA_RULE)
       pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
@@ -1217,8 +1215,6 @@ void OSDMap::build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
     pools[pool].object_hash = CEPH_STR_HASH_RJENKINS;
     pools[pool].pg_num = (maxosd + 1) << pg_bits;
     pools[pool].pgp_num = (maxosd + 1) << pgp_bits;
-    pools[pool].lpg_num = 0;
-    pools[pool].lpgp_num = 0;
     pools[pool].last_change = epoch;
     if (p->first == CEPH_DATA_RULE)
       pools[pool].crash_replay_interval = cct->_conf->osd_default_data_pool_replay_window;
index 1a05e170265c7ffbd9e704a1b8981c9c2a2b3c53..4cfb11bc2d4eb94a34af5dcb0672fff96aa3b7f6 100644 (file)
@@ -458,8 +458,6 @@ void pg_pool_t::dump(Formatter *f) const
   f->dump_int("object_hash", get_object_hash());
   f->dump_int("pg_num", get_pg_num());
   f->dump_int("pg_placement_num", get_pgp_num());
-  f->dump_int("localized_pg_num", get_lpg_num());
-  f->dump_int("localized_pg_placement_num", get_lpgp_num());
   f->dump_unsigned("crash_replay_interval", get_crash_replay_interval());
   f->dump_stream("last_change") << get_last_change();
   f->dump_unsigned("auid", get_auid());
@@ -491,8 +489,6 @@ void pg_pool_t::calc_pg_masks()
 {
   pg_num_mask = (1 << calc_bits_of(pg_num-1)) - 1;
   pgp_num_mask = (1 << calc_bits_of(pgp_num-1)) - 1;
-  lpg_num_mask = (1 << calc_bits_of(lpg_num-1)) - 1;
-  lpgp_num_mask = (1 << calc_bits_of(lpgp_num-1)) - 1;
 }
 
 /*
@@ -594,10 +590,7 @@ SnapContext pg_pool_t::get_snap_context() const
  */
 pg_t pg_pool_t::raw_pg_to_pg(pg_t pg) const
 {
-  if (pg.preferred() >= 0 && lpg_num)
-    pg.set_ps(ceph_stable_mod(pg.ps(), lpg_num, lpg_num_mask));
-  else
-    pg.set_ps(ceph_stable_mod(pg.ps(), pg_num, pg_num_mask));
+  pg.set_ps(ceph_stable_mod(pg.ps(), pg_num, pg_num_mask));
   return pg;
 }
   
@@ -608,10 +601,7 @@ pg_t pg_pool_t::raw_pg_to_pg(pg_t pg) const
  */
 ps_t pg_pool_t::raw_pg_to_pps(pg_t pg) const
 {
-  if (pg.preferred() >= 0 && lpgp_num)
-    return ceph_stable_mod(pg.ps(), lpgp_num, lpgp_num_mask) + pg.pool();
-  else
-    return ceph_stable_mod(pg.ps(), pgp_num, pgp_num_mask) + pg.pool();
+  return ceph_stable_mod(pg.ps(), pgp_num, pgp_num_mask) + pg.pool();
 }
 
 void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
@@ -626,6 +616,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     ::encode(object_hash, bl);
     ::encode(pg_num, bl);
     ::encode(pgp_num, bl);
+    __u32 lpg_num = 0, lpgp_num = 0;  // tell old code that there are no localized pgs.
     ::encode(lpg_num, bl);
     ::encode(lpgp_num, bl);
     ::encode(last_change, bl);
@@ -653,6 +644,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     ::encode(object_hash, bl);
     ::encode(pg_num, bl);
     ::encode(pgp_num, bl);
+    __u32 lpg_num = 0, lpgp_num = 0;  // tell old code that there are no localized pgs.
     ::encode(lpg_num, bl);
     ::encode(lpgp_num, bl);
     ::encode(last_change, bl);
@@ -666,13 +658,14 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     return;
   }
 
-  ENCODE_START(5, 5, bl);
+  ENCODE_START(6, 5, bl);
   ::encode(type, bl);
   ::encode(size, bl);
   ::encode(crush_ruleset, bl);
   ::encode(object_hash, bl);
   ::encode(pg_num, bl);
   ::encode(pgp_num, bl);
+  __u32 lpg_num = 0, lpgp_num = 0;  // tell old code that there are no localized pgs.
   ::encode(lpg_num, bl);
   ::encode(lpgp_num, bl);
   ::encode(last_change, bl);
@@ -688,15 +681,18 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
 
 void pg_pool_t::decode(bufferlist::iterator& bl)
 {
-  DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(6, 5, 5, bl);
   ::decode(type, bl);
   ::decode(size, bl);
   ::decode(crush_ruleset, bl);
   ::decode(object_hash, bl);
   ::decode(pg_num, bl);
   ::decode(pgp_num, bl);
-  ::decode(lpg_num, bl);
-  ::decode(lpgp_num, bl);
+  {
+    __u32 lpg_num, lpgp_num;
+    ::decode(lpg_num, bl);
+    ::decode(lpgp_num, bl);
+  }
   ::decode(last_change, bl);
   ::decode(snap_seq, bl);
   ::decode(snap_epoch, bl);
@@ -744,8 +740,6 @@ void pg_pool_t::generate_test_instances(list<pg_pool_t*>& o)
   a.object_hash = 4;
   a.pg_num = 6;
   a.pgp_num = 5;
-  a.lpg_num = 8;
-  a.lpgp_num = 7;
   a.last_change = 9;
   a.snap_seq = 10;
   a.snap_epoch = 11;
@@ -773,8 +767,6 @@ ostream& operator<<(ostream& out, const pg_pool_t& p)
       << " object_hash " << p.get_object_hash_name()
       << " pg_num " << p.get_pg_num()
       << " pgp_num " << p.get_pgp_num()
-      << " lpg_num " << p.get_lpg_num()
-      << " lpgp_num " << p.get_lpgp_num()
       << " last_change " << p.get_last_change()
       << " owner " << p.get_auid();
   if (p.flags)
index 66a7aff5a09798c2713040bab778d4d3fe22fd4a..ef1ee6f6c8a7fc1a4df2ae126e077728180c1713 100644 (file)
@@ -606,7 +606,6 @@ struct pg_pool_t {
   __u8 crush_ruleset;       /// crush placement rule set
   __u8 object_hash;         /// hash mapping object name to ps
   __u32 pg_num, pgp_num;    /// number of pgs
-  __u32 lpg_num, lpgp_num;  /// number of localized pgs
   epoch_t last_change;      /// most recent epoch changed, exclusing snapshot changes
   snapid_t snap_seq;        /// seq for per-pool snapshot
   epoch_t snap_epoch;       /// osdmap epoch of last snap
@@ -627,16 +626,16 @@ struct pg_pool_t {
    */
   interval_set<snapid_t> removed_snaps;
 
-  int pg_num_mask, pgp_num_mask, lpg_num_mask, lpgp_num_mask;
+  int pg_num_mask, pgp_num_mask;
 
   pg_pool_t()
     : flags(0), type(0), size(0), crush_ruleset(0), object_hash(0),
-      pg_num(0), pgp_num(0), lpg_num(0), lpgp_num(0),
+      pg_num(0), pgp_num(0),
       last_change(0),
       snap_seq(0), snap_epoch(0),
       auid(0),
       crash_replay_interval(0),
-      pg_num_mask(0), pgp_num_mask(0), lpg_num_mask(0), lpgp_num_mask(0) { }
+      pg_num_mask(0), pgp_num_mask(0) { }
 
   void dump(Formatter *f) const;
 
@@ -662,13 +661,9 @@ struct pg_pool_t {
 
   unsigned get_pg_num() const { return pg_num; }
   unsigned get_pgp_num() const { return pgp_num; }
-  unsigned get_lpg_num() const { return lpg_num; }
-  unsigned get_lpgp_num() const { return lpgp_num; }
 
   unsigned get_pg_num_mask() const { return pg_num_mask; }
   unsigned get_pgp_num_mask() const { return pgp_num_mask; }
-  unsigned get_lpg_num_mask() const { return lpg_num_mask; }
-  unsigned get_lpgp_num_mask() const { return lpgp_num_mask; }
 
   static int calc_bits_of(int t);
   void calc_pg_masks();