From: Brad Hubbard Date: Wed, 21 Dec 2016 04:44:00 +0000 (+1000) Subject: OSDMap: Uncomment code to enable private default constructors X-Git-Tag: v12.0.0~368^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12597%2Fhead;p=ceph.git OSDMap: Uncomment code to enable private default constructors C++11 is here so let's enable this code. Signed-off-by: Brad Hubbard --- diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index c2b79655ad36..d7d8a404e91c 100644 --- a/src/mgr/PyModules.cc +++ b/src/mgr/PyModules.cc @@ -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); }); diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index ddbfbb8d67ce..b9a1f5e54454 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -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; diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index 972878b22455..c0d43b9d46a9 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -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" diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index d5ce63a98c1b..997e60ef407e 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -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;