]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg_meta: use initializer list for passing set<> 28461/head
authorKefu Chai <kchai@redhat.com>
Sun, 9 Jun 2019 10:10:02 +0000 (18:10 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 9 Jun 2019 10:11:27 +0000 (18:11 +0800)
we cannot assume that the data in string views are always nul
terminated.

this change partially reverts 82fedbd0089073cfe86640eaa7d73ed1e2545c31.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/pg_meta.cc

index 391b3182668f5eb392fdd0a078aa3ab5211dbb66..4cf2051ec34a314e4f92859d015f90204804e77e 100644 (file)
@@ -32,11 +32,10 @@ namespace {
 seastar::future<epoch_t> PGMeta::get_epoch()
 {
   auto ch = store->open_collection(coll_t{pgid});
-  std::set<std::string> keys{infover_key.data(), 
-                             epoch_key.data()};
   return store->omap_get_values(ch,
                                 pgid.make_pgmeta_oid(),
-                                keys).then(
+                                {string{infover_key},
+                                 string{epoch_key}}).then(
     [](auto&& values) {
       {
         // sanity check
@@ -57,13 +56,12 @@ seastar::future<epoch_t> PGMeta::get_epoch()
 seastar::future<pg_info_t, PastIntervals> PGMeta::load()
 {
   auto ch = store->open_collection(coll_t{pgid});
-  std::set<std::string> keys{infover_key.data(),
-                             info_key.data(),
-                             biginfo_key.data(),
-                             fastinfo_key.data()};
   return store->omap_get_values(ch,
                                 pgid.make_pgmeta_oid(),
-                                keys).then(
+                                {string{infover_key},
+                                 string{info_key},
+                                 string{biginfo_key},
+                                 string{fastinfo_key}}).then(
     [this](auto&& values) {
       {
         // sanity check