]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/osd/: add appropriate OSDMapRef defs for seastar to OSDMap,osd_types
authorSamuel Just <sjust@redhat.com>
Thu, 30 May 2019 00:31:38 +0000 (17:31 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 30 May 2019 17:53:42 +0000 (10:53 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/OSDMap.h
src/osd/osd_types.h

index 37a7380e98383feb4ca9f95329cdb1e4e8c2c8ec..a18612e4a3339bf572d10feb9a53a0b88809fb68 100644 (file)
@@ -30,6 +30,7 @@
 #include <map>
 #include <memory>
 
+#include <boost/smart_ptr/local_shared_ptr.hpp>
 #include "include/btree_map.h"
 #include "include/types.h"
 #include "common/ceph_releases.h"
@@ -1504,7 +1505,12 @@ public:
 WRITE_CLASS_ENCODER_FEATURES(OSDMap)
 WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental)
 
-typedef std::shared_ptr<const OSDMap> OSDMapRef;
+#ifdef WITH_SEASTAR
+using OSDMapRef = boost::local_shared_ptr<const OSDMap>;
+#else
+using OSDMapRef = std::shared_ptr<const OSDMap>;
+#endif
+
 
 inline std::ostream& operator<<(std::ostream& out, const OSDMap& m) {
   m.print_oneline_summary(out);
index fc81d58c228890a868795c1d88224016bffc20b6..a86c840b815d2da71a16c6974026a4ea1a6a705a 100644 (file)
@@ -27,6 +27,7 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/optional/optional_io.hpp>
 #include <boost/variant.hpp>
+#include <boost/smart_ptr/local_shared_ptr.hpp>
 
 #include "include/rados/rados_types.hpp"
 #include "include/mempool.h"
@@ -3014,6 +3015,11 @@ class OSDMap;
  * the might_have_unfound set
  */
 class PastIntervals {
+#ifdef WITH_SEASTAR
+  using OSDMapRef = boost::local_shared_ptr<const OSDMap>;
+#else
+  using OSDMapRef = std::shared_ptr<const OSDMap>;
+#endif
 public:
   struct pg_interval_t {
     std::vector<int32_t> up, acting;
@@ -3192,8 +3198,8 @@ public:
     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
-    std::shared_ptr<const OSDMap> osdmap,      ///< [in] current map
-    std::shared_ptr<const OSDMap> lastmap,     ///< [in] last map
+    OSDMapRef osdmap,      ///< [in] current map
+    OSDMapRef lastmap,     ///< [in] last map
     pg_t pgid,                                  ///< [in] pgid for pg
     const IsPGRecoverablePredicate &could_have_gone_active, ///< [in] predicate whether the pg can be active
     PastIntervals *past_intervals,              ///< [out] intervals