From 077cedff6e13e57a2e3bc67975aaf19bee9267f6 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Sun, 30 Jun 2024 17:51:41 +0800 Subject: [PATCH] crimson/os/seastore: rename PhysicalNodeMapping::is_parent_valid() to PhysicalNodeMapping::is_parent_viewable() Signed-off-by: Xuehan Xu --- src/crimson/os/seastore/btree/btree_range_pin.cc | 2 +- src/crimson/os/seastore/btree/btree_range_pin.h | 2 +- src/crimson/os/seastore/cached_extent.h | 2 +- .../os/seastore/lba_manager/btree/btree_lba_manager.h | 4 ++-- src/crimson/os/seastore/transaction_manager.h | 6 +++--- src/test/crimson/seastore/test_transaction_manager.cc | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/crimson/os/seastore/btree/btree_range_pin.cc b/src/crimson/os/seastore/btree/btree_range_pin.cc index 12e078814ccc5..f0d507a24c423 100644 --- a/src/crimson/os/seastore/btree/btree_range_pin.cc +++ b/src/crimson/os/seastore/btree/btree_range_pin.cc @@ -11,7 +11,7 @@ get_child_ret_t BtreeNodeMapping::get_logical_extent( Transaction &t) { - ceph_assert(is_parent_valid()); + ceph_assert(is_parent_viewable()); assert(pos != std::numeric_limits::max()); ceph_assert(t.get_trans_id() == ctx.trans.get_trans_id()); auto &p = (FixedKVNode&)*parent; diff --git a/src/crimson/os/seastore/btree/btree_range_pin.h b/src/crimson/os/seastore/btree/btree_range_pin.h index 7e450f90a849e..56bdf5729be33 100644 --- a/src/crimson/os/seastore/btree/btree_range_pin.h +++ b/src/crimson/os/seastore/btree/btree_range_pin.h @@ -218,7 +218,7 @@ public: get_child_ret_t 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; diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 0214399426d4e..2f8308d5eef8d 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -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; diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h index ca25dc6a2a02b..a5b9bb70c18df 100644 --- a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h +++ b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h @@ -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(*parent); return p.modified_since(parent_modifications); } void maybe_fix_pos() final { - assert(is_parent_valid()); + assert(is_parent_viewable()); if (!parent_modified()) { return; } diff --git a/src/crimson/os/seastore/transaction_manager.h b/src/crimson/os/seastore/transaction_manager.h index 8db88628ed967..1417fd1de0048 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -183,7 +183,7 @@ public: LBAMappingRef pin) { auto fut = base_iertr::make_ready_future(); - 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); diff --git a/src/test/crimson/seastore/test_transaction_manager.cc b/src/test/crimson/seastore/test_transaction_manager.cc index a638896a86e7d..9084c55dec9fe 100644 --- a/src/test/crimson/seastore/test_transaction_manager.cc +++ b/src/test/crimson/seastore/test_transaction_manager.cc @@ -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); -- 2.39.5