Skip to content

Commit 50a3fca

Browse files
committed
crimson/os/seastore/seastore_types: adjust paddr_t::is_real_location()
Signed-off-by: Yingxin Cheng <[email protected]>
1 parent dc0ebca commit 50a3fca

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/crimson/os/seastore/cache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Cache::retire_extent_ret Cache::retire_extent_addr(
5656
LOG_PREFIX(Cache::retire_extent_addr);
5757
TRACET("retire {}~0x{:x}", t, paddr, length);
5858

59-
assert(paddr.is_real() && !paddr.is_block_relative());
59+
assert(paddr.is_real_location());
6060

6161
CachedExtentRef ext;
6262
auto result = t.get_extent(paddr, &ext);

src/crimson/os/seastore/seastore_types.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -647,17 +647,6 @@ struct paddr_t {
647647
return get_device_id() == DEVICE_ID_ROOT;
648648
}
649649

650-
/**
651-
* is_real
652-
*
653-
* indicates whether addr reflects a physical location, absolute, relative,
654-
* or delayed. FAKE segments also count as real so as to reflect the way in
655-
* which unit tests use them.
656-
*/
657-
bool is_real() const {
658-
return !is_zero() && !is_null() && !is_root();
659-
}
660-
661650
bool is_absolute() const {
662651
return get_addr_type() != paddr_types_t::RESERVED;
663652
}
@@ -666,6 +655,16 @@ struct paddr_t {
666655
return get_device_id() == DEVICE_ID_FAKE;
667656
}
668657

658+
/**
659+
* is_real_location
660+
*
661+
* indicates whether addr reflects a real location (valid in lba) --
662+
* absolute, record-relative, or delayed.
663+
*/
664+
bool is_real_location() const {
665+
return is_absolute() || is_delayed() || is_record_relative();
666+
}
667+
669668
auto operator<=>(const paddr_t &) const = default;
670669

671670
DENC(paddr_t, v, p) {

src/crimson/os/seastore/transaction_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class TransactionManager : public ExtentCallbackInterface {
213213
).si_then([this, FNAME, &t, offset, length,
214214
maybe_init=std::move(maybe_init)] (auto pin) mutable
215215
-> read_extent_ret<T> {
216-
if (length != pin->get_length() || !pin->get_val().is_real()) {
216+
if (length != pin->get_length() || !pin->get_val().is_real_location()) {
217217
SUBERRORT(seastore_tm, "{}~0x{:x} {} got wrong pin {}",
218218
t, offset, length, T::TYPE, *pin);
219219
ceph_abort("Impossible");
@@ -240,7 +240,7 @@ class TransactionManager : public ExtentCallbackInterface {
240240
).si_then([this, FNAME, &t, offset,
241241
maybe_init=std::move(maybe_init)] (auto pin) mutable
242242
-> read_extent_ret<T> {
243-
if (!pin->get_val().is_real()) {
243+
if (!pin->get_val().is_real_location()) {
244244
SUBERRORT(seastore_tm, "{} {} got wrong pin {}",
245245
t, offset, T::TYPE, *pin);
246246
ceph_abort("Impossible");

0 commit comments

Comments
 (0)