From 5a028137e8280b63f4d30cf30457b916fa3176fe Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 9 Jun 2019 18:10:02 +0800 Subject: [PATCH] crimson/osd/pg_meta: use initializer list for passing set<> we cannot assume that the data in string views are always nul terminated. this change partially reverts 82fedbd0089073cfe86640eaa7d73ed1e2545c31. Signed-off-by: Kefu Chai --- src/crimson/osd/pg_meta.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/crimson/osd/pg_meta.cc b/src/crimson/osd/pg_meta.cc index 391b3182668..4cf2051ec34 100644 --- a/src/crimson/osd/pg_meta.cc +++ b/src/crimson/osd/pg_meta.cc @@ -32,11 +32,10 @@ namespace { seastar::future PGMeta::get_epoch() { auto ch = store->open_collection(coll_t{pgid}); - std::set 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 PGMeta::get_epoch() seastar::future PGMeta::load() { auto ch = store->open_collection(coll_t{pgid}); - std::set 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