From: Radosław Zarzyński Date: Tue, 26 Apr 2022 20:15:17 +0000 (+0200) Subject: crimson: move PipelineStageIT::enter() dispatch to compile-time X-Git-Tag: v18.0.0~947^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=013661412be3b6e7d8d41d89d7bec259e66ea7c4;p=ceph-ci.git crimson: move PipelineStageIT::enter() dispatch to compile-time The optimization isn't the goal (but rather a side effect). The reason behind this change is to let pipeline stages define exit barriers incorporating `OpT`-dependant `Triggers` to track blocking that happens on the barriers. Signed-off-by: Radosław Zarzyński --- diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index 6dc32007a65..3a35af75abe 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -562,16 +562,13 @@ public: virtual ~PipelineExitBarrierI() {} }; -class PipelineStageI : public Blocker { -public: - virtual seastar::future enter() = 0; -}; - - template class PipelineStageIT : public BlockerT { public: - virtual seastar::future enter() = 0; + template + decltype(auto) enter(Args&&... args) { + return static_cast(this)->enter(std::forward(args)...); + } }; class PipelineHandle { @@ -689,7 +686,7 @@ class OrderedExclusivePhaseT : public PipelineStageIT { } public: - seastar::future enter() final { + seastar::future enter() { return mutex.lock().then([this] { return PipelineExitBarrierI::Ref(new ExitBarrier{this}); }); @@ -753,7 +750,7 @@ class OrderedConcurrentPhaseT : public PipelineStageIT { }; public: - seastar::future enter() final { + seastar::future enter() { return seastar::make_ready_future( new ExitBarrier{this, mutex.lock()}); } @@ -792,7 +789,7 @@ class UnorderedStageT : public PipelineStageIT { }; public: - seastar::future enter() final { + seastar::future enter() { return seastar::make_ready_future( new ExitBarrier); }