]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMap: Uncomment code to enable private default constructors 12597/head
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 21 Dec 2016 04:44:00 +0000 (14:44 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 22 Dec 2016 00:12:16 +0000 (10:12 +1000)
C++11 is here so let's enable this code.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/mgr/PyModules.cc
src/osd/OSDMap.h
src/test/encoding/types.h
src/tools/ceph_objectstore_tool.cc

index c2b79655ad36b227e1ec16d783c6808b6580bc7b..d7d8a404e91cad8b7b12a41db76b25ca8e6ea402 100644 (file)
@@ -214,7 +214,7 @@ PyObject *PyModules::get_python(const std::string &what)
 
     cluster_state.with_osdmap([this, &f](const OSDMap &osd_map){
       cluster_state.with_pgmap(
-          [osd_map, &f](const PGMap &pg_map) {
+          [&osd_map, &f](const PGMap &pg_map) {
         pg_map.dump_fs_stats(nullptr, &f, true);
         pg_map.dump_pool_stats(osd_map, nullptr, &f, true);
       });
index ddbfbb8d67ce36a6f22713ff06f03781dc71841e..b9a1f5e54454200ce98f00dea61fa82d2f7b4a9e 100644 (file)
@@ -275,12 +275,10 @@ private:
   }
 
   // no copying
-  /* oh, how i long for c++11...
 private:
   OSDMap(const OSDMap& other) = default;
-  const OSDMap& operator=(const OSDMap& other) = default;
+  OSDMap& operator=(const OSDMap& other) = default;
 public:
-  */
 
   void deepish_copy_from(const OSDMap& o) {
     *this = o;
index 972878b224558098ca15e6366b416aa6d9f5d4d6..c0d43b9d46a989b4826dd0d24649ffdfd5a4ad65 100644 (file)
@@ -41,7 +41,7 @@ TYPE_FEATUREFUL(entity_inst_t)
 #include "osd/OSDMap.h"
 TYPE(osd_info_t)
 TYPE(osd_xinfo_t)
-TYPE_FEATUREFUL_STRAYDATA(OSDMap)
+TYPE_FEATUREFUL_NOCOPY(OSDMap)
 TYPE_FEATUREFUL_STRAYDATA(OSDMap::Incremental)
 
 #include "crush/CrushWrapper.h"
index d5ce63a98c1bb83be410926ad1a6d31546d843e2..997e60ef407e5a4f1c45dbd301964fc4a18a291e 100644 (file)
@@ -1044,7 +1044,7 @@ int get_pg_metadata(ObjectStore *store, bufferlist &bl, metadata_section &ms,
     bufferlist findmap_bl;
     int ret = get_osdmap(store, ms.map_epoch, findmap, findmap_bl);
     if (ret == 0) {
-      ms.osdmap = findmap;
+      ms.osdmap.deepish_copy_from(findmap);
     } else {
       cerr << "WARNING: No OSDMap in old export,"
            " some objects may be ignored due to a split" << std::endl;