]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/rbm: add mount() to NVMeBlockDevice
authormyoungwon oh <ohmyoungwon@gmail.com>
Mon, 13 Feb 2023 02:26:56 +0000 (11:26 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 25 Feb 2023 03:09:53 +0000 (12:09 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/random_block_manager/nvme_block_device.cc
src/crimson/os/seastore/random_block_manager/nvme_block_device.h

index 7598b8d6456113fff015ee2237beb2bdccd91bf2..c6bca85996e24b7c5c8e09c0aa527be803b25eb6 100644 (file)
@@ -197,6 +197,22 @@ open_ertr::future<> NVMeBlockDevice::open_for_io(
   });
 }
 
+NVMeBlockDevice::mount_ret NVMeBlockDevice::mount()
+{
+  logger().debug(" mount ");
+  return open(device_path, seastar::open_flags::rw | seastar::open_flags::dsync
+  ).safe_then([this] {
+    return read_rbm_header(RBM_START_ADDRESS
+    ).safe_then([](auto s) {
+      return seastar::now();
+    });
+  }).handle_error(
+    mount_ertr::pass_further{},
+    crimson::ct_error::assert_all{
+    "Invalid error mount in NVMeBlockDevice::mount"}
+  );
+}
+
 write_ertr::future<> NVMeBlockDevice::write(
   uint64_t offset,
   bufferptr &bptr,
index 03db41d8fb047f39e4cfc9ec4ba176e68142c4ef..fada2e77331595194122928e1c92a818333c6e28 100644 (file)
@@ -207,9 +207,7 @@ public:
     uint64_t offset,
     uint64_t len) override;
 
-  mount_ret mount() final {
-    return mount_ertr::now();
-  }
+  mount_ret mount() final;
 
   mkfs_ret mkfs(device_config_t config) final {
     using crimson::common::get_conf;