]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/operation: add UnorderedStage
authorSamuel Just <sjust@redhat.com>
Wed, 29 Sep 2021 00:12:18 +0000 (17:12 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 29 Sep 2021 00:12:18 +0000 (17:12 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/common/operation.h

index 3559f6591555dac6e274f3442bea0ab5e82014eb..22fefd005d8bf68eb30453a67a2aadfe9d4e67b1 100644 (file)
@@ -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<PipelineExitBarrierI::Ref> enter() final {
+    return seastar::make_ready_future<PipelineExitBarrierI::Ref>(
+      new ExitBarrier);
+  }
+
+  UnorderedStage(const char *name) : name(name) {}
+
+private:
+  const char * name;
+};
+
+
 }