]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: rename PhysicalNodeMapping::is_parent_valid() to
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 30 Jun 2024 09:51:41 +0000 (17:51 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Mon, 22 Jul 2024 02:38:00 +0000 (10:38 +0800)
PhysicalNodeMapping::is_parent_viewable()

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/btree/btree_range_pin.cc
src/crimson/os/seastore/btree/btree_range_pin.h
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h
src/crimson/os/seastore/transaction_manager.h
src/test/crimson/seastore/test_transaction_manager.cc

index 12e078814ccc5dc746d164b3b97a0d5df160a08e..f0d507a24c423645739ac48f1da3861106b9b098 100644 (file)
@@ -11,7 +11,7 @@ get_child_ret_t<LogicalCachedExtent>
 BtreeNodeMapping<key_t, val_t>::get_logical_extent(
   Transaction &t)
 {
-  ceph_assert(is_parent_valid());
+  ceph_assert(is_parent_viewable());
   assert(pos != std::numeric_limits<uint16_t>::max());
   ceph_assert(t.get_trans_id() == ctx.trans.get_trans_id());
   auto &p = (FixedKVNode<key_t>&)*parent;
index 7e450f90a849e4eb317cacbfdbd85179e5beca01..56bdf5729be337fb1246b7488bd7a4e8b89c5331 100644 (file)
@@ -218,7 +218,7 @@ public:
   get_child_ret_t<LogicalCachedExtent> get_logical_extent(Transaction&) final;
   bool is_stable() const final;
   bool is_data_stable() const final;
-  bool is_parent_valid() const final {
+  bool is_parent_viewable() const final {
     ceph_assert(parent);
     if (!parent->is_valid()) {
       return false;
index 0214399426d4ef87d15e3dea9296d024a67bc378..2f8308d5eef8d6a807a5b27fdfae981b3ce72297 100644 (file)
@@ -1154,7 +1154,7 @@ public:
   bool is_zero_reserved() const {
     return !get_val().is_real();
   }
-  virtual bool is_parent_valid() const = 0;
+  virtual bool is_parent_viewable() const = 0;
   virtual bool parent_modified() const {
     ceph_abort("impossible");
     return false;
index ca25dc6a2a02ba03eef2e21b6bc9d831fd8af2e8..a5b9bb70c18dfd2017255d90f2bf9623fc44518f 100644 (file)
@@ -163,13 +163,13 @@ public:
 
   bool parent_modified() const final {
     ceph_assert(parent);
-    ceph_assert(is_parent_valid());
+    ceph_assert(is_parent_viewable());
     auto &p = static_cast<LBALeafNode&>(*parent);
     return p.modified_since(parent_modifications);
   }
 
   void maybe_fix_pos() final {
-    assert(is_parent_valid());
+    assert(is_parent_viewable());
     if (!parent_modified()) {
       return;
     }
index 8db88628ed96737bab0d178c6c06740fac3eb5ff..1417fd1de004888135c9596093f66dc885431a71 100644 (file)
@@ -183,7 +183,7 @@ public:
     LBAMappingRef pin)
   {
     auto fut = base_iertr::make_ready_future<LBAMappingRef>();
-    if (!pin->is_parent_valid()) {
+    if (!pin->is_parent_viewable()) {
       fut = get_pin(t, pin->get_key()
       ).handle_error_interruptible(
        crimson::ct_error::enoent::assert_failure{"unexpected enoent"},
@@ -211,7 +211,7 @@ public:
     Transaction &t,
     LBAMappingRef pin)
   {
-    ceph_assert(pin->is_parent_valid());
+    ceph_assert(pin->is_parent_viewable());
     // checking the lba child must be atomic with creating
     // and linking the absent child
     auto v = pin->get_logical_extent(t);
@@ -475,7 +475,7 @@ public:
       // The according extent might be stable or pending.
       auto fut = base_iertr::now();
       if (!pin->is_indirect()) {
-       if (!pin->is_parent_valid()) {
+       if (!pin->is_parent_viewable()) {
          fut = get_pin(t, pin->get_key()
          ).si_then([&pin](auto npin) {
            assert(npin);
index a638896a86e7ddbfee0e60908dce77502022bc48..9084c55dec9fefe3afde46f007b6f3a0d0afbdc8 100644 (file)
@@ -2193,12 +2193,12 @@ TEST_P(tm_single_device_test_t, invalid_lba_mapping_detect)
     {
       auto t = create_transaction();
       auto pin = get_pin(t, (LEAF_NODE_CAPACITY - 1) * 4096);
-      assert(pin->is_parent_valid());
+      assert(pin->is_parent_viewable());
       auto extent = alloc_extent(t, LEAF_NODE_CAPACITY * 4096, 4096, 'a');
-      assert(!pin->is_parent_valid());
+      assert(!pin->is_parent_viewable());
       pin = get_pin(t, LEAF_NODE_CAPACITY * 4096);
       std::ignore = alloc_extent(t, (LEAF_NODE_CAPACITY + 1) * 4096, 4096, 'a');
-      assert(pin->is_parent_valid());
+      assert(pin->is_parent_viewable());
       assert(pin->parent_modified());
       pin->maybe_fix_pos();
       auto v = pin->get_logical_extent(*t.t);