Skip to content

Commit 077cedf

Browse files
committed
crimson/os/seastore: rename PhysicalNodeMapping::is_parent_valid() to
PhysicalNodeMapping::is_parent_viewable() Signed-off-by: Xuehan Xu <[email protected]>
1 parent b87f614 commit 077cedf

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/crimson/os/seastore/btree/btree_range_pin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ get_child_ret_t<LogicalCachedExtent>
1111
BtreeNodeMapping<key_t, val_t>::get_logical_extent(
1212
Transaction &t)
1313
{
14-
ceph_assert(is_parent_valid());
14+
ceph_assert(is_parent_viewable());
1515
assert(pos != std::numeric_limits<uint16_t>::max());
1616
ceph_assert(t.get_trans_id() == ctx.trans.get_trans_id());
1717
auto &p = (FixedKVNode<key_t>&)*parent;

src/crimson/os/seastore/btree/btree_range_pin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class BtreeNodeMapping : public PhysicalNodeMapping<key_t, val_t> {
218218
get_child_ret_t<LogicalCachedExtent> get_logical_extent(Transaction&) final;
219219
bool is_stable() const final;
220220
bool is_data_stable() const final;
221-
bool is_parent_valid() const final {
221+
bool is_parent_viewable() const final {
222222
ceph_assert(parent);
223223
if (!parent->is_valid()) {
224224
return false;

src/crimson/os/seastore/cached_extent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ class PhysicalNodeMapping {
11541154
bool is_zero_reserved() const {
11551155
return !get_val().is_real();
11561156
}
1157-
virtual bool is_parent_valid() const = 0;
1157+
virtual bool is_parent_viewable() const = 0;
11581158
virtual bool parent_modified() const {
11591159
ceph_abort("impossible");
11601160
return false;

src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ class BtreeLBAMapping : public BtreeNodeMapping<laddr_t, paddr_t> {
163163

164164
bool parent_modified() const final {
165165
ceph_assert(parent);
166-
ceph_assert(is_parent_valid());
166+
ceph_assert(is_parent_viewable());
167167
auto &p = static_cast<LBALeafNode&>(*parent);
168168
return p.modified_since(parent_modifications);
169169
}
170170

171171
void maybe_fix_pos() final {
172-
assert(is_parent_valid());
172+
assert(is_parent_viewable());
173173
if (!parent_modified()) {
174174
return;
175175
}

src/crimson/os/seastore/transaction_manager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class TransactionManager : public ExtentCallbackInterface {
183183
LBAMappingRef pin)
184184
{
185185
auto fut = base_iertr::make_ready_future<LBAMappingRef>();
186-
if (!pin->is_parent_valid()) {
186+
if (!pin->is_parent_viewable()) {
187187
fut = get_pin(t, pin->get_key()
188188
).handle_error_interruptible(
189189
crimson::ct_error::enoent::assert_failure{"unexpected enoent"},
@@ -211,7 +211,7 @@ class TransactionManager : public ExtentCallbackInterface {
211211
Transaction &t,
212212
LBAMappingRef pin)
213213
{
214-
ceph_assert(pin->is_parent_valid());
214+
ceph_assert(pin->is_parent_viewable());
215215
// checking the lba child must be atomic with creating
216216
// and linking the absent child
217217
auto v = pin->get_logical_extent(t);
@@ -475,7 +475,7 @@ class TransactionManager : public ExtentCallbackInterface {
475475
// The according extent might be stable or pending.
476476
auto fut = base_iertr::now();
477477
if (!pin->is_indirect()) {
478-
if (!pin->is_parent_valid()) {
478+
if (!pin->is_parent_viewable()) {
479479
fut = get_pin(t, pin->get_key()
480480
).si_then([&pin](auto npin) {
481481
assert(npin);

src/test/crimson/seastore/test_transaction_manager.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,12 +2193,12 @@ TEST_P(tm_single_device_test_t, invalid_lba_mapping_detect)
21932193
{
21942194
auto t = create_transaction();
21952195
auto pin = get_pin(t, (LEAF_NODE_CAPACITY - 1) * 4096);
2196-
assert(pin->is_parent_valid());
2196+
assert(pin->is_parent_viewable());
21972197
auto extent = alloc_extent(t, LEAF_NODE_CAPACITY * 4096, 4096, 'a');
2198-
assert(!pin->is_parent_valid());
2198+
assert(!pin->is_parent_viewable());
21992199
pin = get_pin(t, LEAF_NODE_CAPACITY * 4096);
22002200
std::ignore = alloc_extent(t, (LEAF_NODE_CAPACITY + 1) * 4096, 4096, 'a');
2201-
assert(pin->is_parent_valid());
2201+
assert(pin->is_parent_viewable());
22022202
assert(pin->parent_modified());
22032203
pin->maybe_fix_pos();
22042204
auto v = pin->get_logical_extent(*t.t);

0 commit comments

Comments
 (0)