]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: avoid using variadic future
authorKefu Chai <kchai@redhat.com>
Sun, 24 May 2020 04:25:38 +0000 (12:25 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 24 May 2020 04:26:37 +0000 (12:26 +0800)
see also 3cee25ba41069e9e9b4855f99be20910759440ca

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

index cbf7795771f7961eafb3ae2955539177dfc2a7bd..4b80ee55de45b0e96718ec2bc4272bac6a2d5e0d 100644 (file)
@@ -374,7 +374,8 @@ seastar::future<> PG::read_state(crimson::os::FuturizedStore* store)
 {
   return seastar::do_with(PGMeta(store, pgid), [] (auto& pg_meta) {
     return pg_meta.load();
-  }).then([this, store](pg_info_t pg_info, PastIntervals past_intervals) {
+  }).then([this, store](auto&& ret) {
+    auto [pg_info, past_intervals] = std::move(ret);
     return peering_state.init_from_disk_state(
        std::move(pg_info),
        std::move(past_intervals),
index e07ac6a6e339c148c5057ad24300579a37026aee..e5dda965aa667cd5a8264b693b59b10466a489b9 100644 (file)
@@ -57,7 +57,7 @@ seastar::future<epoch_t> PGMeta::get_epoch()
   });
 }
 
-seastar::future<pg_info_t, PastIntervals> PGMeta::load()
+seastar::future<std::tuple<pg_info_t, PastIntervals>> PGMeta::load()
 {
   return store->open_collection(coll_t{pgid}).then([this](auto ch) {
     return store->omap_get_values(ch,
@@ -95,8 +95,7 @@ seastar::future<pg_info_t, PastIntervals> PGMeta::load()
         fast_info->try_apply_to(&info);
       }
     }
-    return seastar::make_ready_future<pg_info_t, PastIntervals>(
-      std::move(info),
-      std::move(past_intervals));
+    return seastar::make_ready_future<std::tuple<pg_info_t, PastIntervals>>(
+      std::make_tuple(std::move(info), std::move(past_intervals)));
   });
 }
index 656d5b9be097f56af09e27a193b3234ebb64b6d7..e0aa02716917b93dfbef1e258b4c61c0e5e750a8 100644 (file)
@@ -3,6 +3,7 @@
 
 #pragma once
 
+#include <tuple>
 #include <seastar/core/future.hh>
 #include "osd/osd_types.h"
 
@@ -18,5 +19,5 @@ class PGMeta
 public:
   PGMeta(crimson::os::FuturizedStore *store, spg_t pgid);
   seastar::future<epoch_t> get_epoch();
-  seastar::future<pg_info_t, PastIntervals> load();
+  seastar::future<std::tuple<pg_info_t, PastIntervals>> load();
 };