From: Yingxin Cheng Date: Tue, 21 May 2024 05:56:12 +0000 (+0800) Subject: crimson/os/seastore/seastore_types: use utility to compare incompatible types X-Git-Tag: v19.1.1~213^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9fedf44694a04e932e741bf08e19dc195606dc2;p=ceph.git crimson/os/seastore/seastore_types: use utility to compare incompatible types Signed-off-by: Yingxin Cheng (cherry picked from commit 3af14e29654ebd5a671986073b37504e441ab4a1) --- diff --git a/src/crimson/os/seastore/seastore_types.cc b/src/crimson/os/seastore/seastore_types.cc index 93818ba02586..1ca34e61dd8e 100644 --- a/src/crimson/os/seastore/seastore_types.cc +++ b/src/crimson/os/seastore/seastore_types.cc @@ -2,6 +2,9 @@ // vim: ts=8 sw=2 smarttab #include "crimson/os/seastore/seastore_types.h" + +#include + #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(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;