]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blk/zoned: remove dead VDO code
authorSage Weil <sage@newdream.net>
Fri, 3 Sep 2021 21:22:30 +0000 (16:22 -0500)
committerSage Weil <sage@newdream.net>
Fri, 29 Oct 2021 13:55:56 +0000 (09:55 -0400)
VDO won't work on an SMR device

Signed-off-by: Sage Weil <sage@newdream.net>
src/blk/zoned/HMSMRDevice.cc
src/blk/zoned/HMSMRDevice.h

index c94e89588c2411ddffdb93f514bff3c29d5aca23..f16ab1be694174ca54394a14d494e6d3a4208ab6 100644 (file)
@@ -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<string,string> *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<string,string> *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<uint64_t>& 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
index 356affdc11e737c6e026c263293d9fe17f9f0703..f3cd98f391fc00a3f00b59e6560d27a6bdeb1cce 100644 (file)
@@ -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);