@@ -74,7 +74,7 @@ class read_set_item_t {
7474 &read_set_item_t ::trans_hook>;
7575
7676public:
77- struct cmp_t {
77+ struct extent_cmp_t {
7878 using is_transparent = paddr_t ;
7979 bool operator ()(const read_set_item_t <T> &lhs, const read_set_item_t &rhs) const ;
8080 bool operator ()(const paddr_t &lhs, const read_set_item_t <T> &rhs) const ;
@@ -113,10 +113,14 @@ class read_set_item_t {
113113 read_set_item_t (read_set_item_t &&) = default ;
114114 ~read_set_item_t () = default ;
115115};
116+
116117template <typename T>
117- using read_set_t = std::set<
118+ using read_extent_set_t = std::set<
118119 read_set_item_t <T>,
119- typename read_set_item_t <T>::cmp_t >;
120+ typename read_set_item_t <T>::extent_cmp_t >;
121+
122+ template <typename T>
123+ using read_trans_set_t = typename read_set_item_t <T>::trans_set_t ;
120124
121125struct trans_spec_view_t {
122126 // if the extent is pending, contains the id of the owning transaction;
@@ -403,6 +407,8 @@ class CachedExtent
403407 virtual extent_types_t get_type () const = 0;
404408
405409 virtual bool is_logical () const {
410+ assert (!is_logical_type (get_type ()));
411+ assert (is_physical_type (get_type ()));
406412 return false ;
407413 }
408414
@@ -872,7 +878,7 @@ class CachedExtent
872878 CachedExtent* get_transactional_view (Transaction &t);
873879 CachedExtent* get_transactional_view (transaction_id_t tid);
874880
875- read_set_item_t <Transaction>:: trans_set_t transactions ;
881+ read_trans_set_t <Transaction> read_transactions ;
876882
877883 placement_hint_t user_hint = PLACEMENT_HINT_NULL;
878884
@@ -881,7 +887,7 @@ class CachedExtent
881887 rewrite_gen_t rewrite_generation = NULL_GENERATION;
882888
883889protected:
884- trans_view_set_t mutation_pendings ;
890+ trans_view_set_t mutation_pending_extents ;
885891 trans_view_set_t retired_transactions;
886892
887893 CachedExtent (CachedExtent &&other) = delete ;
@@ -1167,7 +1173,7 @@ template <typename T, typename C, typename Cmp>
11671173class addr_extent_set_base_t
11681174 : public std::set<C, Cmp> {};
11691175
1170- using pextent_set_t = addr_extent_set_base_t <
1176+ using retired_extent_set_t = addr_extent_set_base_t <
11711177 paddr_t ,
11721178 trans_retired_extent_link_t ,
11731179 ref_paddr_cmp
@@ -1349,10 +1355,6 @@ class RetiredExtentPlaceholder : public CachedExtent {
13491355 ceph_assert (0 == " Should never happen for a placeholder" );
13501356 }
13511357
1352- bool is_logical () const final {
1353- return false ;
1354- }
1355-
13561358 void on_rewrite (Transaction &, CachedExtent&, extent_len_t ) final {}
13571359
13581360 std::ostream &print_detail (std::ostream &out) const final {
@@ -1406,6 +1408,8 @@ class LogicalCachedExtent : public CachedExtent {
14061408 }
14071409
14081410 bool is_logical () const final {
1411+ assert (is_logical_type (get_type ()));
1412+ assert (!is_physical_type (get_type ()));
14091413 return true ;
14101414 }
14111415
@@ -1468,17 +1472,17 @@ read_set_item_t<T>::read_set_item_t(T *t, CachedExtentRef ref)
14681472{}
14691473
14701474template <typename T>
1471- inline bool read_set_item_t <T>::cmp_t ::operator ()(
1475+ inline bool read_set_item_t <T>::extent_cmp_t ::operator ()(
14721476 const read_set_item_t <T> &lhs, const read_set_item_t <T> &rhs) const {
14731477 return lhs.ref ->poffset < rhs.ref ->poffset ;
14741478}
14751479template <typename T>
1476- inline bool read_set_item_t <T>::cmp_t ::operator ()(
1480+ inline bool read_set_item_t <T>::extent_cmp_t ::operator ()(
14771481 const paddr_t &lhs, const read_set_item_t <T> &rhs) const {
14781482 return lhs < rhs.ref ->poffset ;
14791483}
14801484template <typename T>
1481- inline bool read_set_item_t <T>::cmp_t ::operator ()(
1485+ inline bool read_set_item_t <T>::extent_cmp_t ::operator ()(
14821486 const read_set_item_t <T> &lhs, const paddr_t &rhs) const {
14831487 return lhs.ref ->poffset < rhs;
14841488}
0 commit comments