From 61147363c276a5f419b0781c49aee4812f42d7e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Zarzy=C5=84ski?= Date: Sat, 2 Apr 2022 14:14:21 +0200 Subject: [PATCH] crimson/osd: pipeline stage classes derive from BlockerT now MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Radosław Zarzyński --- src/crimson/common/operation.h | 37 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 59016db1a2d..2bc5f5d1e9d 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -485,6 +485,13 @@ public: virtual seastar::future enter() = 0; }; + +template +class PipelineStageIT : public BlockerT { +public: + virtual seastar::future enter() = 0; +}; + class PipelineHandle { PipelineExitBarrierI::Ref barrier; @@ -551,11 +558,8 @@ public: * resolve) a new phase prior to exiting the previous one will ensure that * the op ordering is preserved. */ -class OrderedExclusivePhase : public PipelineStageI { +class OrderedExclusivePhase : public PipelineStageIT { void dump_detail(ceph::Formatter *f) const final; - const char *get_type_name() const final { - return name; - } class ExitBarrier final : public PipelineExitBarrierI { OrderedExclusivePhase *phase; @@ -593,10 +597,11 @@ public: }); } - OrderedExclusivePhase(const char *name) : name(name) {} + OrderedExclusivePhase(const char *type_name) : type_name(type_name) {} + + const char * type_name; private: - const char * name; seastar::shared_mutex mutex; }; @@ -605,11 +610,8 @@ private: * they will proceed to the next stage in the order in which they called * enter. */ -class OrderedConcurrentPhase : public PipelineStageI { +class OrderedConcurrentPhase : public PipelineStageIT { void dump_detail(ceph::Formatter *f) const final; - const char *get_type_name() const final { - return name; - } class ExitBarrier final : public PipelineExitBarrierI { OrderedConcurrentPhase *phase; @@ -655,10 +657,11 @@ public: new ExitBarrier{this, mutex.lock()}); } - OrderedConcurrentPhase(const char *name) : name(name) {} + OrderedConcurrentPhase(const char *type_name) : type_name(type_name) {} + + const char * type_name; private: - const char * name; seastar::shared_mutex mutex; }; @@ -667,11 +670,8 @@ private: * may exit in any order. Useful mainly for informational purposes between * stages with constraints. */ -class UnorderedStage : public PipelineStageI { +class UnorderedStage : public PipelineStageIT { void dump_detail(ceph::Formatter *f) const final {} - const char *get_type_name() const final { - return name; - } class ExitBarrier final : public PipelineExitBarrierI { public: @@ -694,10 +694,9 @@ public: new ExitBarrier); } - UnorderedStage(const char *name) : name(name) {} + UnorderedStage(const char *type_name) : type_name(type_name) {} -private: - const char * name; + const char * type_name; }; -- 2.39.5