summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/segment_manager
diff options
context:
space:
mode:
authorZhang Song <zhangsong325@gmail.com>2023-03-06 08:06:19 +0100
committerZhang Song <zhangsong325@gmail.com>2023-03-15 02:21:08 +0100
commit1e515e8561519ded43b1046942057d705441ee22 (patch)
treec6a09aa197b99be22c0874622ae35307cbeb5dc0 /src/crimson/os/seastore/segment_manager
parentcrimson/os/seastore: make segment_manager work with HDD (diff)
downloadceph-1e515e8561519ded43b1046942057d705441ee22.tar.xz
ceph-1e515e8561519ded43b1046942057d705441ee22.zip
crimson/os/seastore: specify the device type explicitly when constructing BlockSegmentManager
Signed-off-by: Zhang Song <zhangsong325@gmail.com>
Diffstat (limited to 'src/crimson/os/seastore/segment_manager')
-rw-r--r--src/crimson/os/seastore/segment_manager/block.cc1
-rw-r--r--src/crimson/os/seastore/segment_manager/block.h8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/crimson/os/seastore/segment_manager/block.cc b/src/crimson/os/seastore/segment_manager/block.cc
index d0c34f36d82..04b83b56c5f 100644
--- a/src/crimson/os/seastore/segment_manager/block.cc
+++ b/src/crimson/os/seastore/segment_manager/block.cc
@@ -516,6 +516,7 @@ BlockSegmentManager::mkfs_ret BlockSegmentManager::mkfs(
device_config_t sm_config)
{
LOG_PREFIX(BlockSegmentManager::mkfs);
+ ceph_assert(sm_config.spec.dtype == superblock.config.spec.dtype);
set_device_id(sm_config.spec.id);
INFO("{} path={}, {}",
device_id_printer_t{get_device_id()}, device_path, sm_config);
diff --git a/src/crimson/os/seastore/segment_manager/block.h b/src/crimson/os/seastore/segment_manager/block.h
index 03662d5521e..4fa715ba71f 100644
--- a/src/crimson/os/seastore/segment_manager/block.h
+++ b/src/crimson/os/seastore/segment_manager/block.h
@@ -118,8 +118,12 @@ public:
close_ertr::future<> close();
BlockSegmentManager(
- const std::string &path)
- : device_path(path) {}
+ const std::string &path,
+ device_type_t dtype)
+ : device_path(path) {
+ ceph_assert(get_device_type() == device_type_t::NONE);
+ superblock.config.spec.dtype = dtype;
+ }
~BlockSegmentManager();