From 55b37c35e7fd4e2f21ffe104ccb7ca682fe0f8ab Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 28 Sep 2021 17:12:18 -0700 Subject: [PATCH] crimson/common/operation: add UnorderedStage Signed-off-by: Samuel Just --- src/crimson/common/operation.h | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 3559f659155..22fefd005d8 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -588,4 +588,43 @@ private: seastar::shared_mutex mutex; }; +/** + * Imposes no ordering or exclusivity at all. Ops enter without constraint and + * may exit in any order. Useful mainly for informational purposes between + * stages with constraints. + */ +class UnorderedStage : public PipelineStageI { + void dump_detail(ceph::Formatter *f) const final {} + const char *get_type_name() const final { + return name; + } + + class ExitBarrier final : public PipelineExitBarrierI { + public: + ExitBarrier() = default; + + seastar::future<> wait() final { + return seastar::now(); + } + + void exit() final {} + + void cancel() final {} + + ~ExitBarrier() final {} + }; + +public: + seastar::future enter() final { + return seastar::make_ready_future( + new ExitBarrier); + } + + UnorderedStage(const char *name) : name(name) {} + +private: + const char * name; +}; + + } -- 2.47.3