* resolve) a new phase prior to exiting the previous one will ensure that
* the op ordering is preserved.
*/
-class OrderedExclusivePhase : public PipelineStageIT<OrderedExclusivePhase> {
- void dump_detail(ceph::Formatter *f) const final;
+template <class T>
+class OrderedExclusivePhaseT : public PipelineStageIT<T> {
+ void dump_detail(ceph::Formatter *f) const final {}
class ExitBarrier final : public PipelineExitBarrierI {
- OrderedExclusivePhase *phase;
+ OrderedExclusivePhaseT *phase;
public:
- ExitBarrier(OrderedExclusivePhase *phase) : phase(phase) {}
+ ExitBarrier(OrderedExclusivePhaseT *phase) : phase(phase) {}
seastar::future<> wait() final {
return seastar::now();
});
}
- OrderedExclusivePhase(const char *type_name) : type_name(type_name) {}
-
- const char * type_name;
-
private:
seastar::shared_mutex mutex;
};
+// TODO: drop this after migrating to the new event tracking infrastructure.
+struct OrderedExclusivePhase : OrderedExclusivePhaseT<OrderedExclusivePhase> {
+ OrderedExclusivePhase(const char *type_name) : type_name(type_name) {}
+ const char * type_name;
+};
+
/**
* Permits multiple ops to inhabit the stage concurrently, but ensures that
* they will proceed to the next stage in the order in which they called
* enter.
*/
-class OrderedConcurrentPhase : public PipelineStageIT<OrderedConcurrentPhase> {
- void dump_detail(ceph::Formatter *f) const final;
+template <class T>
+class OrderedConcurrentPhaseT : public PipelineStageIT<T> {
+ void dump_detail(ceph::Formatter *f) const final {}
class ExitBarrier final : public PipelineExitBarrierI {
- OrderedConcurrentPhase *phase;
+ OrderedConcurrentPhaseT *phase;
std::optional<seastar::future<>> barrier;
public:
ExitBarrier(
- OrderedConcurrentPhase *phase,
+ OrderedConcurrentPhaseT *phase,
seastar::future<> &&barrier) : phase(phase), barrier(std::move(barrier)) {}
seastar::future<> wait() final {
new ExitBarrier{this, mutex.lock()});
}
- OrderedConcurrentPhase(const char *type_name) : type_name(type_name) {}
-
- const char * type_name;
-
private:
seastar::shared_mutex mutex;
};
+struct OrderedConcurrentPhase : OrderedConcurrentPhaseT<OrderedConcurrentPhase> {
+ OrderedConcurrentPhase(const char *type_name) : type_name(type_name) {}
+ const char * type_name;
+};
+
/**
* 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 PipelineStageIT<UnorderedStage> {
+template <class T>
+class UnorderedStageT : public PipelineStageIT<T> {
void dump_detail(ceph::Formatter *f) const final {}
class ExitBarrier final : public PipelineExitBarrierI {
return seastar::make_ready_future<PipelineExitBarrierI::Ref>(
new ExitBarrier);
}
+};
+struct UnorderedStage : UnorderedStageT<UnorderedStage> {
UnorderedStage(const char *type_name) : type_name(type_name) {}
-
const char * type_name;
};
-
}