]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/errorator: construct future<> with a future_state_base 32797/head
authorKefu Chai <kchai@redhat.com>
Thu, 23 Jan 2020 07:38:11 +0000 (15:38 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 23 Jan 2020 07:52:33 +0000 (15:52 +0800)
this change is made to adapt
https://github.com/scylladb/seastar/commit/89e801b373423b068b3a70e50b656348f549ade0

* always use the helpers from `futurize` instead of using
  `::seastar::make_exception_future()` directly. as
  `make_exception_future(future_state_base&& state)` is located in
  `seastar::internal` namespace
* add `noexcept` specifier in both constructors. to match with the
  helpers of `make_exception_future2()` which dispatch the call to
  different constructor variants.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/errorator.h

index 064daaffa4a430f3c88aab8c551e67eae3910f43..f26b65847c4e8fb1866c085f1942283bf00fd370 100644 (file)
@@ -388,8 +388,12 @@ private:
       : base_t(::seastar::make_ready_future<ValuesT...>(std::forward<A>(a)...)) {
     }
     [[gnu::always_inline]]
-    _future(exception_future_marker, std::exception_ptr&& ep)
-      : base_t(::seastar::make_exception_future<ValuesT...>(std::move(ep))) {
+    _future(exception_future_marker, ::seastar::future_state_base&& state) noexcept
+      : base_t(::seastar::futurize<base_t>::make_exception_future(std::move(state))) {
+    }
+    [[gnu::always_inline]]
+    _future(exception_future_marker, std::exception_ptr&& ep) noexcept
+      : base_t(::seastar::futurize<base_t>::make_exception_future(std::move(ep))) {
     }
 
     template <template <class...> class ErroratedFuture,
@@ -701,6 +705,11 @@ public:
   future<T...> make_exception_future2(std::exception_ptr&& ex) noexcept {
     return future<T...>(exception_future_marker(), std::move(ex));
   }
+  template <typename... T>
+  static
+  future<T...> make_exception_future2(seastar::future_state_base&& state) noexcept {
+    return future<T...>(exception_future_marker(), std::move(state));
+  }
   template <typename... T, typename Exception>
   static
   future<T...> make_exception_future2(Exception&& ex) noexcept {