]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: misc renames
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 20 Mar 2025 07:54:59 +0000 (15:54 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 21 Mar 2025 03:19:28 +0000 (11:19 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/btree/btree_range_pin.h
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cache.h
src/crimson/os/seastore/cached_extent.cc
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/linked_tree_node.h
src/crimson/os/seastore/transaction.h

index bfd350a8bed4fd980a6e14908d42cc27791e5439..b8fb5085aafabe0feb40c6bfc0b65d777a4be043 100644 (file)
@@ -182,7 +182,7 @@ public:
       assert(extent.is_pending_in_trans(t.get_trans_id()));
       return false;
     }
-    auto &pendings = extent.mutation_pendings;
+    auto &pendings = extent.mutation_pending_extents;
     auto trans_id = t.get_trans_id();
     bool unviewable = (pendings.find(trans_id, trans_spec_view_t::cmp_t()) !=
                       pendings.end());
index 2a2488d64cd0fbc8eaaafaa88954455f36adaa85..4dd49caf8ca388bff9c00d405bb3581b36a931e9 100644 (file)
@@ -919,14 +919,14 @@ void Cache::invalidate_extent(
     CachedExtent& extent)
 {
   if (!extent.may_conflict()) {
-    assert(extent.transactions.empty());
+    assert(extent.read_transactions.empty());
     extent.set_invalid(t);
     return;
   }
 
   LOG_PREFIX(Cache::invalidate_extent);
   bool do_conflict_log = true;
-  for (auto &&i: extent.transactions) {
+  for (auto &&i: extent.read_transactions) {
     if (!i.t->conflicted) {
       if (do_conflict_log) {
         SUBDEBUGT(seastore_t, "conflict begin -- {}", t, extent);
@@ -1181,7 +1181,7 @@ CachedExtentRef Cache::duplicate_for_write(
   ret->prior_instance = i;
   // duplicate_for_write won't occur after ool write finished
   assert(!i->prior_poffset);
-  auto [iter, inserted] = i->mutation_pendings.insert(*ret);
+  auto [iter, inserted] = i->mutation_pending_extents.insert(*ret);
   ceph_assert(inserted);
   t.add_mutated_extent(ret);
   if (is_root_type(ret->get_type())) {
index a916e13e31186f4b4990d7dd220439e0ac40a457..8dfaa04cbcd1032915a546ac42e81344db342530 100644 (file)
@@ -688,8 +688,8 @@ private:
       on_cache(*ret);
 
       // replace placeholder in transactions
-      while (!cached->transactions.empty()) {
-        auto t = cached->transactions.begin()->t;
+      while (!cached->read_transactions.empty()) {
+        auto t = cached->read_transactions.begin()->t;
         t->replace_placeholder(*cached, *ret);
       }
 
index 8a00a6d4d8352150ef50b4700e3a6f346e5eeb66..6bceb999c37a2bc22c6c5de00b57491097924f78 100644 (file)
@@ -81,8 +81,8 @@ CachedExtent* CachedExtent::get_transactional_view(Transaction &t) {
 }
 
 CachedExtent* CachedExtent::get_transactional_view(transaction_id_t tid) {
-  auto it = mutation_pendings.find(tid, trans_spec_view_t::cmp_t());
-  if (it != mutation_pendings.end()) {
+  auto it = mutation_pending_extents.find(tid, trans_spec_view_t::cmp_t());
+  if (it != mutation_pending_extents.end()) {
     return (CachedExtent*)&(*it);
   } else {
     return this;
index 1bed954713b04988f33ae175559e8b6a6403b9a6..81f79044356c1d828fddd98e97b1b6929207d73a 100644 (file)
@@ -74,7 +74,7 @@ class read_set_item_t {
     &read_set_item_t::trans_hook>;
 
 public:
-  struct cmp_t {
+  struct extent_cmp_t {
     using is_transparent = paddr_t;
     bool operator()(const read_set_item_t<T> &lhs, const read_set_item_t &rhs) const;
     bool operator()(const paddr_t &lhs, const read_set_item_t<T> &rhs) const;
@@ -113,10 +113,14 @@ public:
   read_set_item_t(read_set_item_t &&) = default;
   ~read_set_item_t() = default;
 };
+
 template <typename T>
-using read_set_t = std::set<
+using read_extent_set_t = std::set<
   read_set_item_t<T>,
-  typename read_set_item_t<T>::cmp_t>;
+  typename read_set_item_t<T>::extent_cmp_t>;
+
+template <typename T>
+using read_trans_set_t = typename read_set_item_t<T>::trans_set_t;
 
 struct trans_spec_view_t {
   // if the extent is pending, contains the id of the owning transaction;
@@ -874,7 +878,7 @@ private:
   CachedExtent* get_transactional_view(Transaction &t);
   CachedExtent* get_transactional_view(transaction_id_t tid);
 
-  read_set_item_t<Transaction>::trans_set_t transactions;
+  read_trans_set_t<Transaction> read_transactions;
 
   placement_hint_t user_hint = PLACEMENT_HINT_NULL;
 
@@ -883,7 +887,7 @@ private:
   rewrite_gen_t rewrite_generation = NULL_GENERATION;
 
 protected:
-  trans_view_set_t mutation_pendings;
+  trans_view_set_t mutation_pending_extents;
   trans_view_set_t retired_transactions;
 
   CachedExtent(CachedExtent &&other) = delete;
@@ -1169,7 +1173,7 @@ template <typename T, typename C, typename Cmp>
 class addr_extent_set_base_t
   : public std::set<C, Cmp> {};
 
-using pextent_set_t = addr_extent_set_base_t<
+using retired_extent_set_t = addr_extent_set_base_t<
   paddr_t,
   trans_retired_extent_link_t,
   ref_paddr_cmp
@@ -1468,17 +1472,17 @@ read_set_item_t<T>::read_set_item_t(T *t, CachedExtentRef ref)
 {}
 
 template <typename T>
-inline bool read_set_item_t<T>::cmp_t::operator()(
+inline bool read_set_item_t<T>::extent_cmp_t::operator()(
   const read_set_item_t<T> &lhs, const read_set_item_t<T> &rhs) const {
   return lhs.ref->poffset < rhs.ref->poffset;
 }
 template <typename T>
-inline bool read_set_item_t<T>::cmp_t::operator()(
+inline bool read_set_item_t<T>::extent_cmp_t::operator()(
   const paddr_t &lhs, const read_set_item_t<T> &rhs) const {
   return lhs < rhs.ref->poffset;
 }
 template <typename T>
-inline bool read_set_item_t<T>::cmp_t::operator()(
+inline bool read_set_item_t<T>::extent_cmp_t::operator()(
   const read_set_item_t<T> &lhs, const paddr_t &rhs) const {
   return lhs.ref->poffset < rhs;
 }
index 76be226ebb725adb3faf69eb39785c869d199d97..9ed0f67fb7785c52bcae525421ac1f1ca664908d 100644 (file)
@@ -302,9 +302,9 @@ public:
   TCachedExtentRef<T> find_pending_version(Transaction &t, node_key_t key) {
     auto &me = down_cast();
     assert(me.is_stable());
-    auto mut_iter = me.mutation_pendings.find(
+    auto mut_iter = me.mutation_pending_extents.find(
       t.get_trans_id(), trans_spec_view_t::cmp_t());
-    if (mut_iter != me.mutation_pendings.end()) {
+    if (mut_iter != me.mutation_pending_extents.end()) {
       assert(copy_dests_by_trans.find(t.get_trans_id()) ==
        copy_dests_by_trans.end());
       return static_cast<T*>(&(*mut_iter));
index cd8c333c69fa3ce7e3884acf47501762046d163e..a3dfa7261a07d7adc9e4976bb71f9906db8de49a 100644 (file)
@@ -171,15 +171,15 @@ public:
 
     assert(ref->is_valid());
 
-    auto it = ref->transactions.lower_bound(
+    auto it = ref->read_transactions.lower_bound(
       this, read_set_item_t<Transaction>::trans_cmp_t());
-    if (it != ref->transactions.end() && it->t == this) {
+    if (it != ref->read_transactions.end() && it->t == this) {
       return false;
     }
 
     auto [iter, inserted] = read_set.emplace(this, ref);
     ceph_assert(inserted);
-    ref->transactions.insert_before(
+    ref->read_transactions.insert_before(
       it, const_cast<read_set_item_t<Transaction>&>(*iter));
     return true;
   }
@@ -191,13 +191,13 @@ public:
 
     assert(ref->is_valid());
 
-    auto it = ref->transactions.lower_bound(
+    auto it = ref->read_transactions.lower_bound(
       this, read_set_item_t<Transaction>::trans_cmp_t());
-    assert(it == ref->transactions.end() || it->t != this);
+    assert(it == ref->read_transactions.end() || it->t != this);
 
     auto [iter, inserted] = read_set.emplace(this, ref);
     ceph_assert(inserted);
-    ref->transactions.insert_before(
+    ref->read_transactions.insert_before(
       it, const_cast<read_set_item_t<Transaction>&>(*iter));
   }
 
@@ -306,7 +306,7 @@ public:
       assert(where->ref.get() == &placeholder);
       where = read_set.erase(where);
       auto it = read_set.emplace_hint(where, this, &extent);
-      extent.transactions.insert(const_cast<read_set_item_t<Transaction>&>(*it));
+      extent.read_transactions.insert(const_cast<read_set_item_t<Transaction>&>(*it));
     }
     {
       auto where = retired_set.find(&placeholder);
@@ -610,7 +610,7 @@ private:
    * Submitting a transaction mutating any contained extent/addr will
    * invalidate *this.
    */
-  read_set_t<Transaction> read_set; ///< set of extents read by paddr
+  read_extent_set_t<Transaction> read_set; ///< set of extents read by paddr
 
   uint64_t fresh_backref_extents = 0; // counter of new backref extents
 
@@ -663,7 +663,7 @@ private:
    *
    * Set of extents retired by *this.
    */
-  pextent_set_t retired_set;
+  retired_extent_set_t retired_set;
 
   /// stats to collect when commit or invalidate
   tree_stats_t onode_tree_stats;