From 3f1b065454c0175b946762a6d9ffd3f1bfabdb72 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 3 Sep 2021 16:22:30 -0500 Subject: [PATCH] blk/zoned: remove dead VDO code VDO won't work on an SMR device Signed-off-by: Sage Weil --- src/blk/zoned/HMSMRDevice.cc | 29 +---------------------------- src/blk/zoned/HMSMRDevice.h | 4 ---- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/blk/zoned/HMSMRDevice.cc b/src/blk/zoned/HMSMRDevice.cc index c94e89588c2..f16ab1be694 100644 --- a/src/blk/zoned/HMSMRDevice.cc +++ b/src/blk/zoned/HMSMRDevice.cc @@ -249,7 +249,6 @@ int HMSMRDevice::open(const string& p) rotational = blkdev_buffered.is_rotational(); support_discard = blkdev_buffered.support_discard(); this->devname = devname; - _detect_vdo(); } } @@ -306,11 +305,6 @@ void HMSMRDevice::close() _aio_stop(); _discard_stop(); - if (vdo_fd >= 0) { - VOID_TEMP_FAILURE_RETRY(::close(vdo_fd)); - vdo_fd = -1; - } - for (int i = 0; i < WRITE_LIFE_MAX; i++) { assert(fd_directs[i] >= 0); VOID_TEMP_FAILURE_RETRY(::close(fd_directs[i])); @@ -335,12 +329,6 @@ int HMSMRDevice::collect_metadata(const string& prefix, map *pm) } else { (*pm)[prefix + "type"] = "ssd"; } - if (vdo_fd >= 0) { - (*pm)[prefix + "vdo"] = "true"; - uint64_t total, avail; - get_vdo_utilization(vdo_fd, &total, &avail); - (*pm)[prefix + "vdo_physical_size"] = stringify(total); - } { string res_names; @@ -407,18 +395,6 @@ int HMSMRDevice::collect_metadata(const string& prefix, map *pm) return 0; } -void HMSMRDevice::_detect_vdo() -{ - vdo_fd = get_vdo_stats_handle(devname.c_str(), &vdo_name); - if (vdo_fd >= 0) { - dout(1) << __func__ << " VDO volume " << vdo_name - << " maps to " << devname << dendl; - } else { - dout(20) << __func__ << " no VDO volume maps to " << devname << dendl; - } - return; -} - void HMSMRDevice::reset_all_zones() { zbd_reset_zones(zbd_fd, conventional_region_size, 0); @@ -434,10 +410,7 @@ void HMSMRDevice::reset_zones(const std::set& zones) { bool HMSMRDevice::get_thin_utilization(uint64_t *total, uint64_t *avail) const { - if (vdo_fd < 0) { - return false; - } - return get_vdo_utilization(vdo_fd, total, avail); + return false; } int HMSMRDevice::choose_fd(bool buffered, int write_hint) const diff --git a/src/blk/zoned/HMSMRDevice.h b/src/blk/zoned/HMSMRDevice.h index 356affdc11e..f3cd98f391f 100644 --- a/src/blk/zoned/HMSMRDevice.h +++ b/src/blk/zoned/HMSMRDevice.h @@ -37,9 +37,6 @@ class HMSMRDevice final : public BlockDevice { std::string path; bool aio, dio; - int vdo_fd = -1; ///< fd for vdo sysfs directory - std::string vdo_name; - std::string devname; ///< kernel dev name (/sys/block/$devname), if any int zbd_fd = -1; ///< fd for the zoned block device @@ -110,7 +107,6 @@ class HMSMRDevice final : public BlockDevice { void debug_aio_link(aio_t& aio); void debug_aio_unlink(aio_t& aio); - void _detect_vdo(); int choose_fd(bool buffered, int write_hint) const; bool set_smr_params(const std::string& path); -- 2.39.5