From: Samuel Just Date: Wed, 29 Sep 2021 00:12:18 +0000 (-0700) Subject: crimson/common/operation: add UnorderedStage X-Git-Tag: v17.1.0~780^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=55b37c35e7fd4e2f21ffe104ccb7ca682fe0f8ab;p=ceph.git crimson/common/operation: add UnorderedStage Signed-off-by: Samuel Just --- diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 3559f6591555..22fefd005d8b 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; +}; + + }