From cd8a069ab394ae6f2ad76a999fa1b2fd23a542b1 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 24 Aug 2022 15:42:33 -0700 Subject: [PATCH] crimson/common: introduce smp_helpers.h, crimson::submit_to Introduce crimson::submit_to wrapper to transparently deal with vanilla and errorated futures, adds helpers to errorator.h. Signed-off-by: Samuel Just --- src/crimson/common/errorator.h | 18 +++++++ src/crimson/common/smp_helpers.h | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 src/crimson/common/smp_helpers.h diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index c6c1a8b476d..aee05f66915 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -475,6 +475,10 @@ private: : base_t(std::move(base)) { } + base_t to_base() && { + return std::move(*this); + } + template [[gnu::always_inline]] _future(ready_future_marker, A&&... a) @@ -1199,6 +1203,20 @@ using stateful_errc = stateful_error_t; using stateful_errint = stateful_error_t; using stateful_ec = stateful_error_t; +template +struct is_errorated_future { + static constexpr bool value = false; +}; +template