]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg_map: add 'PGMap::get_pgs() const'
authorKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 06:12:37 +0000 (14:12 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 15:59:30 +0000 (23:59 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/pg_map.h

index 1018d5ac5176fe64f4f35135b48da53e650ad7b3..67f1a6a505b99765f1c6cc9b6c2a9ac3a01fcecf 100644 (file)
@@ -37,7 +37,8 @@ class PGMap {
   };
 
   std::map<spg_t, PGCreationState> pgs_creating;
-  std::map<spg_t, Ref<PG>> pgs;
+  using pgs_t = std::map<spg_t, Ref<PG>>;
+  pgs_t pgs;
 
 public:
   /**
@@ -61,8 +62,8 @@ public:
    */
   void pg_loaded(spg_t pgid, Ref<PG> pg);
 
-  decltype(pgs) &get_pgs() { return pgs; }
-
+  pgs_t& get_pgs() { return pgs; }
+  const pgs_t& get_pgs() const { return pgs; }
   PGMap() = default;
   ~PGMap();
 };