virtual int get_ebd_state(ExtBlkDevState &state) const {
return -ENOENT;
}
- virtual int get_ebd_id(std::string& id) const {
+ virtual int detect_ebd(std::string& id) {
return -ENOENT;
}
support_discard = blkdev_buffered.support_discard();
optimal_io_size = blkdev_buffered.get_optimal_io_size();
this->devname = devname;
- // check if any extended block device plugin recognizes this device
- // detect_vdo has moved into the VDO plugin
- int rc = extblkdev::detect_device(cct, devname, ebd_impl);
- if (rc != 0) {
- dout(20) << __func__ << " no plugin volume maps to " << devname << dendl;
- }
}
}
return -ENOENT;
}
-int KernelDevice::get_ebd_id(std::string& id) const {
+int KernelDevice::detect_ebd(std::string& id)
+{
+ // check if any extended block device plugin recognizes this device
+ // detect_vdo has moved into the VDO plugin
+ if (!ebd_impl) {
+ int rc = extblkdev::detect_device(cct, devname, ebd_impl);
+ if (rc != 0) {
+ dout(20) << __func__ << " no plugin volume maps to " << devname << dendl;
+ }
+ }
if (ebd_impl) {
return ebd_impl->get_plugin_id(id);
}
int get_devices(std::set<std::string> *ls) const override;
int get_ebd_state(ExtBlkDevState &state) const override;
- int get_ebd_id(std::string& id) const override;
+ int detect_ebd(std::string& id) override;
int read(uint64_t off, uint64_t len, ceph::buffer::list *pbl,
IOContext *ioc,
derr << "Failed preloading extblkdev plugins, error code: " << plugin_preload_r << dendl;
}
string bdev_plugin_id;
- r = bdev->get_ebd_id(bdev_plugin_id);
+ r = bdev->detect_ebd(bdev_plugin_id);
bool is_osd = cct->get_module_type() & CEPH_ENTITY_TYPE_OSD;
if (r != 0) {
derr << __func__ << " plugin " << meta_plugin_id << " not loaded" << dendl;
if (cct->_conf->bluestore_use_ebd) {
// check if EBD plugin is enabled
string plugin_id;
- r = bdev->get_ebd_id(plugin_id);
+ r = bdev->detect_ebd(plugin_id);
if (r == 0) {
// retrieved name, save plugin into bdev metadata
r = write_meta("extblkdev", plugin_id);