]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: Seastore::omap_list cleanup
authorXinyu Huang <xinyu.huang@intel.com>
Wed, 14 Dec 2022 06:01:02 +0000 (06:01 +0000)
committerXinyu Huang <xinyu.huang@intel.com>
Wed, 14 Dec 2022 06:13:25 +0000 (06:13 +0000)
Signed-off-by: Xinyu Huang <xinyu.huang@intel.com>
src/crimson/os/seastore/seastore.cc
src/crimson/os/seastore/seastore.h

index 6f67f6c68ec2cede2a5ab1a23b933da022b000b5..6a8eec23fc948ba1fc5b08fee86df745dbe1e863 100644 (file)
@@ -734,7 +734,7 @@ SeaStore::get_attrs_ertr::future<SeaStore::attrs_t> SeaStore::get_attrs(
     op_type_t::GET_ATTRS,
     [=, this](auto &t, auto& onode) {
       auto& layout = onode.get_layout();
-      return _omap_list(onode, layout.xattr_root, t, std::nullopt,
+      return omap_list(onode, layout.xattr_root, t, std::nullopt,
         OMapManager::omap_list_config_t().with_inclusive(false, false)
       ).si_then([&layout](auto p) {
         auto& attrs = std::get<1>(p);
@@ -879,7 +879,7 @@ SeaStore::_omap_get_values_ret SeaStore::_omap_get_values(
   );
 }
 
-SeaStore::_omap_list_ret SeaStore::_omap_list(
+SeaStore::omap_list_ret SeaStore::omap_list(
   Onode &onode,
   const omap_root_le_t& omap_root,
   Transaction& t,
@@ -889,7 +889,7 @@ SeaStore::_omap_list_ret SeaStore::_omap_list(
   auto root = omap_root.get(
     onode.get_metadata_hint(device->get_block_size()));
   if (root.is_null()) {
-    return seastar::make_ready_future<_omap_list_bare_ret>(
+    return seastar::make_ready_future<omap_list_bare_ret>(
       true, omap_values_t{}
     );
   }
@@ -903,14 +903,13 @@ SeaStore::_omap_list_ret SeaStore::_omap_list(
   });
 }
 
-SeaStore::omap_get_values_ret_t SeaStore::omap_list(
+SeaStore::omap_get_values_ret_t SeaStore::omap_get_values(
   CollectionRef ch,
   const ghobject_t &oid,
-  const std::optional<string> &start,
-  OMapManager::omap_list_config_t config)
+  const std::optional<string> &start)
 {
   auto c = static_cast<SeastoreCollection*>(ch.get());
-  LOG_PREFIX(SeaStore::omap_list);
+  LOG_PREFIX(SeaStore::omap_get_values);
   DEBUG("{} {}", c->get_cid(), oid);
   using ret_bare_t = std::tuple<bool, SeaStore::omap_values_t>;
   return repeat_with_onode<ret_bare_t>(
@@ -919,26 +918,13 @@ SeaStore::omap_get_values_ret_t SeaStore::omap_list(
     Transaction::src_t::READ,
     "omap_list",
     op_type_t::OMAP_LIST,
-    [this, config, start](auto &t, auto &onode) {
-      return _omap_list(
+    [this, start](auto &t, auto &onode) {
+      return omap_list(
        onode,
        onode.get_layout().omap_root,
-       t, start, config
-      );
-  });
-}
-
-SeaStore::omap_get_values_ret_t SeaStore::omap_get_values(
-  CollectionRef ch,
-  const ghobject_t &oid,
-  const std::optional<string> &start)
-{
-  return seastar::do_with(
-    oid,
-    [this, start, ch=std::move(ch)](auto& oid) {
-    return omap_list(
-      ch, oid, start,
-      OMapManager::omap_list_config_t().with_inclusive(false, false));
+       t,
+       start,
+       OMapManager::omap_list_config_t().with_inclusive(false, false));
   });
 }
 
index 9b8833e73a570dada6319316f36d838c5dce9da4..25c5492b890c8f80cd2c1f060e488daebd3d8be6 100644 (file)
@@ -304,22 +304,17 @@ private:
     omap_root_t &&root,
     const omap_keys_t &keys) const;
 
-  using _omap_list_bare_ret = OMapManager::omap_list_bare_ret;
-  using _omap_list_ret = OMapManager::omap_list_ret;
-  _omap_list_ret _omap_list(
+  friend class SeaStoreOmapIterator;
+
+  using omap_list_bare_ret = OMapManager::omap_list_bare_ret;
+  using omap_list_ret = OMapManager::omap_list_ret;
+  omap_list_ret omap_list(
     Onode &onode,
     const omap_root_le_t& omap_root,
     Transaction& t,
     const std::optional<std::string>& start,
     OMapManager::omap_list_config_t config) const;
 
-  friend class SeaStoreOmapIterator;
-  omap_get_values_ret_t omap_list(
-    CollectionRef ch,
-    const ghobject_t &oid,
-    const std::optional<std::string> &_start,
-    OMapManager::omap_list_config_t config);
-
   void init_managers();
 
   std::string root;