From d9fedf44694a04e932e741bf08e19dc195606dc2 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Tue, 21 May 2024 13:56:12 +0800 Subject: [PATCH] crimson/os/seastore/seastore_types: use utility to compare incompatible types Signed-off-by: Yingxin Cheng (cherry picked from commit 3af14e29654ebd5a671986073b37504e441ab4a1) --- src/crimson/os/seastore/seastore_types.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/crimson/os/seastore/seastore_types.cc b/src/crimson/os/seastore/seastore_types.cc index 93818ba025864..1ca34e61dd8e1 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; -- 2.39.5