From: myoungwon oh Date: Mon, 13 Feb 2023 02:26:56 +0000 (+0900) Subject: crimson/os/seastore/rbm: add mount() to NVMeBlockDevice X-Git-Tag: v18.1.0~271^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0305cedf24ddf2177ad129558084c3154e5f56f;p=ceph.git crimson/os/seastore/rbm: add mount() to NVMeBlockDevice Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/random_block_manager/nvme_block_device.cc b/src/crimson/os/seastore/random_block_manager/nvme_block_device.cc index 7598b8d645611..c6bca85996e24 100644 --- a/src/crimson/os/seastore/random_block_manager/nvme_block_device.cc +++ b/src/crimson/os/seastore/random_block_manager/nvme_block_device.cc @@ -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, diff --git a/src/crimson/os/seastore/random_block_manager/nvme_block_device.h b/src/crimson/os/seastore/random_block_manager/nvme_block_device.h index 03db41d8fb047..fada2e7733159 100644 --- a/src/crimson/os/seastore/random_block_manager/nvme_block_device.h +++ b/src/crimson/os/seastore/random_block_manager/nvme_block_device.h @@ -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;