From: Radosław Zarzyński Date: Sat, 2 Apr 2022 12:14:21 +0000 (+0200) Subject: crimson/osd: pipeline stage classes derive from BlockerT now X-Git-Tag: v18.0.0~947^2~45 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61147363c276a5f419b0781c49aee4812f42d7e8;p=ceph.git crimson/osd: pipeline stage classes derive from BlockerT now Signed-off-by: Radosław Zarzyński --- diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 59016db1a2da..2bc5f5d1e9da 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; };