]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/seastore_types: use utility to compare incompatible types
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 21 May 2024 05:56:12 +0000 (13:56 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 16 Jun 2024 10:22:27 +0000 (13:22 +0300)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
(cherry picked from commit 3af14e29654ebd5a671986073b37504e441ab4a1)

src/crimson/os/seastore/seastore_types.cc

index 93818ba02586459d8558b7cec5fc9ac0ee0fcf66..1ca34e61dd8e1720685049b92b23e4b3ea107d75 100644 (file)
@@ -2,6 +2,9 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "crimson/os/seastore/seastore_types.h"
+
+#include <utility>
+
 #include "crimson/common/log.h"
 
 namespace {
@@ -160,7 +163,7 @@ journal_seq_t journal_seq_t::add_offset(
       ++new_jseq;
       joff -= roll_size;
     }
-    assert(new_jseq < MAX_SEG_SEQ);
+    assert(std::cmp_less(new_jseq, MAX_SEG_SEQ));
     jseq = static_cast<segment_seq_t>(new_jseq);
   } else {
     device_off_t mod = (-off) / roll_size;
@@ -169,7 +172,7 @@ journal_seq_t journal_seq_t::add_offset(
       ++mod;
       joff += roll_size;
     }
-    if (jseq >= mod) {
+    if (std::cmp_greater_equal(jseq, mod)) {
       jseq -= mod;
     } else {
       return JOURNAL_SEQ_MIN;