]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PgPriorSet -> PriorSet
authorSage Weil <sage@newdream.net>
Thu, 20 Oct 2011 22:51:10 +0000 (15:51 -0700)
committerSage Weil <sage@newdream.net>
Thu, 20 Oct 2011 22:51:10 +0000 (15:51 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/PG.cc
src/osd/PG.h

index 02c6e7a41e5bc42b7ee4ced4c3791e44591d9d4a..c4f73c7e1b79b69c1053f39415bad353f754fcc3 100644 (file)
@@ -1104,7 +1104,7 @@ void PG::mark_all_unfound_as_lost(ObjectStore::Transaction& t)
   share_pg_log(old_last_update);
 }
 
-void PG::build_prior(std::auto_ptr<PgPriorSet> &prior_set)
+void PG::build_prior(std::auto_ptr<PriorSet> &prior_set)
 {
   if (1) {
     // sanity check
@@ -1114,13 +1114,13 @@ void PG::build_prior(std::auto_ptr<PgPriorSet> &prior_set)
       assert(info.history.last_epoch_started >= it->second.history.last_epoch_started);
     }
   }
-  prior_set.reset(new PgPriorSet(*osd->osdmap,
+  prior_set.reset(new PriorSet(*osd->osdmap,
                                 past_intervals,
                                 up,
                                 acting,
                                 info,
                                 this));
-  PgPriorSet &prior(*prior_set.get());
+  PriorSet &prior(*prior_set.get());
                                 
   if (prior.crashed) {
     state_set(PG_STATE_CRASHED);
@@ -1232,7 +1232,7 @@ bool PG::choose_acting(int newest_update_osd) const
   return true;
 }
 
-bool PG::choose_log_location(const PgPriorSet &prior_set,
+bool PG::choose_log_location(const PriorSet &prior_set,
                             bool &need_backlog,
                             bool &wait_on_backlog,
                             int &pull_from,
@@ -3845,9 +3845,9 @@ ostream& operator<<(ostream& out, const PG& pg)
 }
 
 std::ostream& operator<<(std::ostream& oss,
-                        const struct PG::PgPriorSet &prior)
+                        const struct PG::PriorSet &prior)
 {
-  oss << "PgPriorSet[probe=" << prior.probe << " "
+  oss << "PriorSet[probe=" << prior.probe << " "
       << "down=" << prior.down << " "
       << "blocked_by=" << prior.blocked_by << "]";
   return oss;
@@ -4350,7 +4350,7 @@ PG::RecoveryState::GetInfo::GetInfo(my_context ctx) : my_base(ctx)
 
   PG *pg = context< RecoveryMachine >().pg;
   pg->generate_past_intervals();
-  auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+  auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
 
   if (!prior_set.get())
     pg->build_prior(prior_set);
@@ -4364,7 +4364,7 @@ PG::RecoveryState::GetInfo::GetInfo(my_context ctx) : my_base(ctx)
 void PG::RecoveryState::GetInfo::get_infos()
 {
   PG *pg = context< RecoveryMachine >().pg;
-  auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+  auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
 
   for (set<int>::const_iterator it = prior_set->probe.begin();
        it != prior_set->probe.end();
@@ -4403,7 +4403,7 @@ boost::statechart::result PG::RecoveryState::GetInfo::react(const MNotifyRec& in
   epoch_t old_start = pg->info.history.last_epoch_started;
   if (pg->proc_replica_info(infoevt.from, infoevt.info)) {
     // we got something new ...
-    auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+    auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
     if (old_start < pg->info.history.last_epoch_started) {
       dout(10) << " last_epoch_started moved forward, rebuilding prior" << dendl;
       pg->build_prior(prior_set);
@@ -4765,9 +4765,9 @@ void PG::RecoveryState::handle_create(RecoveryCtx *rctx)
 
 /*---------------------------------------------------*/
 #undef dout_prefix
-#define dout_prefix (*_dout << (debug_pg ? debug_pg->gen_prefix() : string()) << " PgPriorSet: ")
+#define dout_prefix (*_dout << (debug_pg ? debug_pg->gen_prefix() : string()) << " PriorSet: ")
 
-PG::PgPriorSet::PgPriorSet(const OSDMap &osdmap,
+PG::PriorSet::PriorSet(const OSDMap &osdmap,
                           const map<epoch_t, Interval> &past_intervals,
                           const vector<int> &up,
                           const vector<int> &acting,
@@ -4935,7 +4935,7 @@ PG::PgPriorSet::PgPriorSet(const OSDMap &osdmap,
 }
 
 // true if the given map affects the prior set
-bool PG::PgPriorSet::affected_by_map(const OSDMap *osdmap, PG *debug_pg) const
+bool PG::PriorSet::affected_by_map(const OSDMap *osdmap, PG *debug_pg) const
 {
   for (set<int>::iterator p = probe.begin();
        p != probe.end();
index 6e33371e4132d5deb42a8b2417acc0d450b0334a..75d337b2962ceee4f0e5d2ee2de8058327048872 100644 (file)
@@ -842,14 +842,14 @@ public:
  protected:
   bool prior_set_built;
 
-  struct PgPriorSet {
+  struct PriorSet {
     set<int> probe; /// current+prior OSDs we need to probe.
     set<int> down;  /// down osds that would normally be in @probe and might be interesting.
     map<int,epoch_t> blocked_by;  /// current lost_at values for any OSDs in cur set for which (re)marking them lost would affect cur set
 
     bool crashed;   /// true if past osd failures were such that clients may need to replay requests.
     bool pg_down;   /// some down osds are included in @cur; the DOWN pg state bit should be set.
-    PgPriorSet(const OSDMap &osdmap,
+    PriorSet(const OSDMap &osdmap,
               const map<epoch_t, Interval> &past_intervals,
               const vector<int> &up,
               const vector<int> &acting,
@@ -860,7 +860,7 @@ public:
   };
 
   friend std::ostream& operator<<(std::ostream& oss,
-                                 const struct PgPriorSet &prior);
+                                 const struct PriorSet &prior);
 
 public:    
   struct RecoveryCtx {
@@ -1138,7 +1138,7 @@ public:
     struct Active;
 
     struct Peering : boost::statechart::state< Peering, Primary, GetInfo >, NamedState {
-      std::auto_ptr< PgPriorSet > prior_set;
+      std::auto_ptr< PriorSet > prior_set;
 
       Peering(my_context ctx);
       void exit();
@@ -1363,7 +1363,7 @@ public:
 
   void generate_past_intervals();
   void trim_past_intervals();
-  void build_prior(std::auto_ptr<PgPriorSet> &prior_set);
+  void build_prior(std::auto_ptr<PriorSet> &prior_set);
   void clear_prior();
 
   bool adjust_need_up_thru(const OSDMap *osdmap);
@@ -1418,7 +1418,7 @@ public:
   void do_peer(ObjectStore::Transaction& t, list<Context*>& tfin,
               map< int, map<pg_t,Query> >& query_map,
               map<int, MOSDPGInfo*> *activator_map=0);
-  bool choose_log_location(const PgPriorSet &prior_set,
+  bool choose_log_location(const PriorSet &prior_set,
                           bool &need_backlog,
                           bool &wait_on_backlog,
                           int &pull_from,