From: Kefu Chai Date: Thu, 22 Aug 2019 08:47:19 +0000 (+0800) Subject: crimson/osd: lift continuation in PGMeta::load() X-Git-Tag: v15.1.0~1751^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=952b88b009f4f8da82ec527041769d3825b4fc87;p=ceph.git crimson/osd: lift continuation in PGMeta::load() after making `open_collection()` return a future, we don't need to chain the body of `PGMeta::load()` after `omap_get_values()`. instead we can lift it. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/pg_meta.cc b/src/crimson/osd/pg_meta.cc index 5510972eb617..30ef48b37c88 100644 --- a/src/crimson/osd/pg_meta.cc +++ b/src/crimson/osd/pg_meta.cc @@ -62,39 +62,38 @@ seastar::future PGMeta::load() {string{infover_key}, string{info_key}, string{biginfo_key}, - string{fastinfo_key}}).then( - [this](auto&& values) { - { - // sanity check - auto infover = find_value<__u8>(values, infover_key); - assert(infover); - if (infover < 10) { - throw std::runtime_error("incompatible pg meta"); - } - } - pg_info_t info; - { - auto found = find_value(values, info_key); - assert(found); - info = *std::move(found); + string{fastinfo_key}}); + }).then([this](auto&& values) { + { + // sanity check + auto infover = find_value<__u8>(values, infover_key); + assert(infover); + if (infover < 10) { + throw std::runtime_error("incompatible pg meta"); } - PastIntervals past_intervals; - { - using biginfo_t = std::pair; - auto big_info = find_value(values, biginfo_key); - assert(big_info); - past_intervals = std::move(big_info->first); - info.purged_snaps = std::move(big_info->second); - } - { - auto fast_info = find_value(values, fastinfo_key); - if (fast_info) { - fast_info->try_apply_to(&info); - } + } + pg_info_t info; + { + auto found = find_value(values, info_key); + assert(found); + info = *std::move(found); + } + PastIntervals past_intervals; + { + using biginfo_t = std::pair; + auto big_info = find_value(values, biginfo_key); + assert(big_info); + past_intervals = std::move(big_info->first); + info.purged_snaps = std::move(big_info->second); + } + { + auto fast_info = find_value(values, fastinfo_key); + if (fast_info) { + fast_info->try_apply_to(&info); } - return seastar::make_ready_future( - std::move(info), - std::move(past_intervals)); - }); + } + return seastar::make_ready_future( + std::move(info), + std::move(past_intervals)); }); }