]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: add mkfs() 25304/head
authorKefu Chai <kchai@redhat.com>
Fri, 18 Jan 2019 04:27:30 +0000 (12:27 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 18 Jan 2019 04:42:08 +0000 (12:42 +0800)
we will need it for preparing crimson-osd without help of ceph-osd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index e51182eeccc29e44d743226a7f82fe26475071d3..72ac133c0d1bd3158b8fa98dd26acf13f462d220 100644 (file)
@@ -46,6 +46,17 @@ OSD::OSD(int id, uint32_t nonce)
 
 OSD::~OSD() = default;
 
+seastar::future<> OSD::mkfs(uuid_d cluster_fsid, int whoami)
+{
+  CyanStore store{local_conf().get_val<std::string>("osd_data")};
+  uuid_d osd_fsid;
+  osd_fsid.generate_random();
+  store.write_meta("fsid", osd_fsid.to_string());
+  store.write_meta("ceph_fsid", cluster_fsid.to_string());
+  store.write_meta("whoami", std::to_string(whoami));
+  return seastar::now();
+}
+
 seastar::future<> OSD::start()
 {
   logger().info("start");
index fe6ba3d652b13d13a193d4707556a4fc3f1aaaf8..9a1ada416ad47dd23455cb95ed36cba084a0c549 100644 (file)
@@ -61,6 +61,8 @@ public:
   OSD(int id, uint32_t nonce);
   ~OSD();
 
+  static seastar::future<> mkfs(uuid_d fsid, int whoami);
+
   seastar::future<> start();
   seastar::future<> stop();