]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/seastore_types: adjust paddr_t::is_real_location()
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 23 Apr 2025 06:21:30 +0000 (14:21 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 24 Apr 2025 01:29:44 +0000 (09:29 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/seastore_types.h
src/crimson/os/seastore/transaction_manager.h

index 53b23025cd6655475a00866b55611b259ed49e4d..2011dd3b2df5fd2c3ebc075405530dcb76ffc029 100644 (file)
@@ -56,7 +56,7 @@ Cache::retire_extent_ret Cache::retire_extent_addr(
   LOG_PREFIX(Cache::retire_extent_addr);
   TRACET("retire {}~0x{:x}", t, paddr, length);
 
-  assert(paddr.is_real() && !paddr.is_block_relative());
+  assert(paddr.is_real_location());
 
   CachedExtentRef ext;
   auto result = t.get_extent(paddr, &ext);
index 29bd7b9c85f12a87f0f82cb6ceb488e502bac9ac..33e08414e6b90ed678b5ccfec35167f574ba3207 100644 (file)
@@ -647,17 +647,6 @@ public:
     return get_device_id() == DEVICE_ID_ROOT;
   }
 
-  /**
-   * is_real
-   *
-   * indicates whether addr reflects a physical location, absolute, relative,
-   * or delayed.  FAKE segments also count as real so as to reflect the way in
-   * which unit tests use them.
-   */
-  bool is_real() const {
-    return !is_zero() && !is_null() && !is_root();
-  }
-
   bool is_absolute() const {
     return get_addr_type() != paddr_types_t::RESERVED;
   }
@@ -666,6 +655,16 @@ public:
     return get_device_id() == DEVICE_ID_FAKE;
   }
 
+  /**
+   * is_real_location
+   *
+   * indicates whether addr reflects a real location (valid in lba) --
+   * absolute, record-relative, or delayed.
+   */
+  bool is_real_location() const {
+    return is_absolute() || is_delayed() || is_record_relative();
+  }
+
   auto operator<=>(const paddr_t &) const = default;
 
   DENC(paddr_t, v, p) {
index e7d449cdd5e6deb0268ac3d8043fc194461c1335..0b8e27deb8816ae230be2bb975ad6fb3690fc711 100644 (file)
@@ -213,7 +213,7 @@ public:
     ).si_then([this, FNAME, &t, offset, length,
              maybe_init=std::move(maybe_init)] (auto pin) mutable
       -> read_extent_ret<T> {
-      if (length != pin->get_length() || !pin->get_val().is_real()) {
+      if (length != pin->get_length() || !pin->get_val().is_real_location()) {
         SUBERRORT(seastore_tm, "{}~0x{:x} {} got wrong pin {}",
                   t, offset, length, T::TYPE, *pin);
         ceph_abort("Impossible");
@@ -240,7 +240,7 @@ public:
     ).si_then([this, FNAME, &t, offset,
              maybe_init=std::move(maybe_init)] (auto pin) mutable
       -> read_extent_ret<T> {
-      if (!pin->get_val().is_real()) {
+      if (!pin->get_val().is_real_location()) {
         SUBERRORT(seastore_tm, "{} {} got wrong pin {}",
                   t, offset, T::TYPE, *pin);
         ceph_abort("Impossible");