assert(super.size >= super.journal_size);
DEBUG("super {} ", super);
// write super block
- return write_rbm_header(
- ).safe_then([] {
- return mkfs_ertr::now();
- }).handle_error(
+ return open(get_device_path(),
+ seastar::open_flags::rw | seastar::open_flags::dsync
+ ).handle_error(
mkfs_ertr::pass_further{},
crimson::ct_error::assert_all{
- "Invalid error write_rbm_header in RBMDevice::mkfs"
+ "Invalid error open in RBMDevice::mkfs"}
+ ).safe_then([this] {
+ return write_rbm_header(
+ ).safe_then([this] {
+ return close();
+ }).handle_error(
+ mkfs_ertr::pass_further{},
+ crimson::ct_error::assert_all{
+ "Invalid error write_rbm_header in RBMDevice::mkfs"
+ });
});
});
}
});
}
+ std::string get_device_path() const final {
+ return device_path;
+ }
+
uint64_t get_preffered_write_granularity() const { return write_granularity; }
uint64_t get_preffered_write_alignment() const { return write_alignment; }
uint64_t get_atomic_write_unit() const { return atomic_write_unit; }
read_ertr::future<seastar::stat_data>;
virtual stat_device_ret stat_device() = 0;
+ virtual std::string get_device_path() const = 0;
+
uint64_t get_journal_size() const {
return super.journal_size;
}
stat
);
}
+
+ std::string get_device_path() const final {
+ return "";
+ }
+
char *buf;
};
using EphemeralRBMDeviceRef = std::unique_ptr<EphemeralRBMDevice>;