ceph_assert(first_segment_offset > tracker_offset &&
first_segment_offset % block_size == 0);
ceph_assert(config.spec.magic != 0);
- ceph_assert(config.spec.dtype == device_type_t::SSD);
+ ceph_assert(get_default_backend_of_device(config.spec.dtype) ==
+ backend_type_t::SEGMENTED);
ceph_assert(config.spec.id <= DEVICE_ID_MAX_VALID);
if (!config.major_dev) {
ceph_assert(config.secondary_devices.size() == 0);
class SegmentManager : public Device {
public:
- device_type_t get_device_type() const final {
- return device_type_t::SSD;
- }
-
backend_type_t get_backend_type() const final {
return backend_type_t::SEGMENTED;
}
size_t len,
ceph::bufferptr &out) final;
+ device_type_t get_device_type() const final {
+ return superblock.config.spec.dtype;
+ }
size_t get_available_size() const final {
return superblock.size;
}
const ephemeral_config_t config;
std::optional<device_config_t> device_config;
+ device_type_t get_device_type() const final {
+ return device_type_t::SEGMENTED_EPHEMERAL;
+ }
+
size_t get_offset(paddr_t addr) {
auto& seg_addr = addr.as_seg_paddr();
return (seg_addr.get_segment_id().device_segment_id() * config.segment_size) +
size_t len,
ceph::bufferptr &out) final;
+ device_type_t get_device_type() const final {
+ return device_type_t::ZNS;
+ }
+
size_t get_available_size() const final {
return metadata.size;
};