]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/osd_types: take bare const OSDMap * to check_new_interval
authorSage Weil <sage@redhat.com>
Fri, 19 Apr 2019 19:52:14 +0000 (14:52 -0500)
committerSage Weil <sage@redhat.com>
Mon, 22 Apr 2019 14:32:35 +0000 (09:32 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index d5f6f0872cdd6b37452bdad89b0751ab5c8c143d..cfd123c0418a3a102f4ff8439816edfa3e1b1a11 100644 (file)
@@ -4739,8 +4739,8 @@ void OSD::build_initial_pg_history(
       up, new_up,
       h->same_interval_since,
       h->last_epoch_clean,
-      osdmap,
-      lastmap,
+      osdmap.get(),
+      lastmap.get(),
       pgid.pgid,
       &min_size_predicate,
       pi,
index 88219371434efb57ec276a12fed9f671e09af4e3..2f5273fc5c2ebd0a21339df1eab9b4bdef28e648 100644 (file)
@@ -6123,8 +6123,8 @@ bool PG::should_restart_peering(
        newupprimary,
        up,
        newup,
-       osdmap,
-       lastmap,
+       osdmap.get(),
+       lastmap.get(),
        info.pgid.pgid)) {
     dout(20) << "new interval newup " << newup
             << " newacting " << newacting << dendl;
@@ -6278,8 +6278,8 @@ void PG::start_peering_interval(
       oldup, newup,
       info.history.same_interval_since,
       info.history.last_epoch_clean,
-      osdmap,
-      lastmap,
+      osdmap.get(),
+      lastmap.get(),
       info.pgid.pgid,
       recoverable.get(),
       &past_intervals,
index d0b3d8b27586caa855b7182056815b1bcf9ad7e3..7540eabe3d0d4d69ab38e86130557574ca249934 100644 (file)
@@ -3774,8 +3774,8 @@ bool PastIntervals::is_new_interval(
   int new_up_primary,
   const vector<int> &old_up,
   const vector<int> &new_up,
-  OSDMapRef osdmap,
-  OSDMapRef lastmap,
+  const OSDMap *osdmap,
+  const OSDMap *lastmap,
   pg_t pgid)
 {
   const pg_pool_t *plast = lastmap->get_pg_pool(pgid.pool());
@@ -3821,8 +3821,8 @@ bool PastIntervals::check_new_interval(
   const vector<int> &new_up,
   epoch_t same_interval_since,
   epoch_t last_epoch_clean,
-  OSDMapRef osdmap,
-  OSDMapRef lastmap,
+  const OSDMap *osdmap,
+  const OSDMap *lastmap,
   pg_t pgid,
   IsPGRecoverablePredicate *could_have_gone_active,
   PastIntervals *past_intervals,
index 78cf6e8592dec4f5c0dec12ae1c91a8b86337f45..d469cf5bf1bc0aeec646f9f6ce1997237e569cff 100644 (file)
@@ -3137,8 +3137,8 @@ public:
     int new_up_primary,                         ///< [in] up primary of osdmap
     const std::vector<int> &old_up,                  ///< [in] up as of lastmap
     const std::vector<int> &new_up,                  ///< [in] up as of osdmap
-    std::shared_ptr<const OSDMap> osdmap,  ///< [in] current map
-    std::shared_ptr<const OSDMap> lastmap, ///< [in] last map
+    const OSDMap *osdmap,  ///< [in] current map
+    const OSDMap *lastmap, ///< [in] last map
     pg_t pgid                                   ///< [in] pgid for pg
     );
 
@@ -3146,6 +3146,24 @@ public:
    * Integrates a new map into *past_intervals, returns true
    * if an interval was closed out.
    */
+  static bool check_new_interval(
+    int old_acting_primary,                     ///< [in] primary as of lastmap
+    int new_acting_primary,                     ///< [in] primary as of osdmap
+    const std::vector<int> &old_acting,              ///< [in] acting as of lastmap
+    const std::vector<int> &new_acting,              ///< [in] acting as of osdmap
+    int old_up_primary,                         ///< [in] up primary of lastmap
+    int new_up_primary,                         ///< [in] up primary of osdmap
+    const std::vector<int> &old_up,                  ///< [in] up as of lastmap
+    const std::vector<int> &new_up,                  ///< [in] up as of osdmap
+    epoch_t same_interval_since,                ///< [in] as of osdmap
+    epoch_t last_epoch_clean,                   ///< [in] current
+    const OSDMap *osdmap,      ///< [in] current map
+    const OSDMap *lastmap,     ///< [in] last map
+    pg_t pgid,                                  ///< [in] pgid for pg
+    IsPGRecoverablePredicate *could_have_gone_active, ///< [in] predicate whether the pg can be active
+    PastIntervals *past_intervals,              ///< [out] intervals
+    std::ostream *out = 0                            ///< [out] debug ostream
+    );
   static bool check_new_interval(
     int old_acting_primary,                     ///< [in] primary as of lastmap
     int new_acting_primary,                     ///< [in] primary as of osdmap
@@ -3163,7 +3181,19 @@ public:
     IsPGRecoverablePredicate *could_have_gone_active, ///< [in] predicate whether the pg can be active
     PastIntervals *past_intervals,              ///< [out] intervals
     std::ostream *out = 0                            ///< [out] debug ostream
-    );
+    ) {
+    return check_new_interval(
+      old_acting_primary, new_acting_primary,
+      old_acting, new_acting,
+      old_up_primary, new_up_primary,
+      old_up, new_up,
+      same_interval_since, last_epoch_clean,
+      osdmap.get(), lastmap.get(),
+      pgid,
+      could_have_gone_active,
+      past_intervals,
+      out);
+  }
 
   friend std::ostream& operator<<(std::ostream& out, const PastIntervals &i);