]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os: move singleton_ec up to let mount() reuse it.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 19 Oct 2021 19:24:47 +0000 (19:24 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 19 Oct 2021 19:25:00 +0000 (19:25 +0000)
No other changes in this commit.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/os/cyanstore/cyan_store.cc

index 3dbe9e874fd4e54361863410a810cf3de4f290f4..f26136675949189165bcf8bea7f34fb4c9ddce5c 100644 (file)
@@ -34,6 +34,25 @@ CyanStore::CyanStore(const std::string& path)
 
 CyanStore::~CyanStore() = default;
 
+template <const char* MsgV>
+struct singleton_ec : std::error_code {
+  singleton_ec()
+    : error_code(42, this_error_category{}) {
+  };
+private:
+  struct this_error_category : std::error_category {
+    const char* name() const noexcept final {
+      // XXX: we could concatenate with MsgV at compile-time but the burden
+      // isn't worth the benefit.
+      return "singleton_ec";
+    }
+    std::string message([[maybe_unused]] const int ev) const final {
+      assert(ev == 42);
+      return MsgV;
+    }
+  };
+};
+
 seastar::future<> CyanStore::mount()
 {
   ceph::bufferlist bl;
@@ -82,25 +101,6 @@ seastar::future<> CyanStore::umount()
   });
 }
 
-template <const char* MsgV>
-struct singleton_ec : std::error_code {
-  singleton_ec()
-    : error_code(42, this_error_category{}) {
-  };
-private:
-  struct this_error_category : std::error_category {
-    const char* name() const noexcept final {
-      // XXX: we could concatenate with MsgV at compile-time but the burden
-      // isn't worth the benefit.
-      return "singleton_ec";
-    }
-    std::string message([[maybe_unused]] const int ev) const final {
-      assert(ev == 42);
-      return MsgV;
-    }
-  };
-};
-
 CyanStore::mkfs_ertr::future<> CyanStore::mkfs(uuid_d new_osd_fsid)
 {
   static const char read_meta_errmsg[]{"read_meta"};