From fe66dc3a3ba1c892ffad35971154d3e0ccb27602 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Zarzy=C5=84ski?= Date: Wed, 27 Apr 2022 16:51:35 +0200 Subject: [PATCH] crimson/osd: strip blokcing_future from OperationT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Radosław Zarzyński --- src/crimson/osd/osd_operation.h | 61 +-------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index 054d6e37424..6fc3071f54d 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -56,66 +56,7 @@ struct InterruptibleOperation : Operation { }; template -class OperationT : public InterruptibleOperation { - std::vector blockers; - - void add_blocker(Blocker *b) { - blockers.push_back(b); - } - - void clear_blocker(Blocker *b) { - auto iter = std::find(blockers.begin(), blockers.end(), b); - if (iter != blockers.end()) { - blockers.erase(iter); - } - } - -public: - template - seastar::future with_blocking_future(blocking_future &&f) { - if (f.fut.available()) { - return std::move(f.fut); - } - assert(f.blocker); - add_blocker(f.blocker); - return std::move(f.fut).then_wrapped([this, blocker=f.blocker](auto &&arg) { - clear_blocker(blocker); - return std::move(arg); - }); - } - - template - ::crimson::interruptible::interruptible_future - with_blocking_future_interruptible(blocking_future &&f) { - if (f.fut.available()) { - return std::move(f.fut); - } - assert(f.blocker); - add_blocker(f.blocker); - auto fut = std::move(f.fut).then_wrapped([this, blocker=f.blocker](auto &&arg) { - clear_blocker(blocker); - return std::move(arg); - }); - return ::crimson::interruptible::interruptible_future< - InterruptCond, U>(std::move(fut)); - } - - template - ::crimson::interruptible::interruptible_future - with_blocking_future_interruptible( - blocking_interruptible_future &&f) { - if (f.fut.available()) { - return std::move(f.fut); - } - assert(f.blocker); - add_blocker(f.blocker); - return std::move(f.fut).template then_wrapped_interruptible( - [this, blocker=f.blocker](auto &&arg) { - clear_blocker(blocker); - return std::move(arg); - }); - } - +struct OperationT : InterruptibleOperation { static constexpr const char *type_name = OP_NAMES[static_cast(T::type)]; using IRef = boost::intrusive_ptr; -- 2.39.5