From c393ff13241793833e391fbc9f4ca9242768ca2c Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Mon, 17 Jun 2019 13:50:07 -0400 Subject: [PATCH] client,rbd,mon: Fix signed compare warnings Signed-off-by: Adam C. Emerson --- src/client/Client.cc | 3 ++- src/librbd/librbd.cc | 8 ++++---- src/mon/OSDMonitor.cc | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 01fd1683dafac..d0e1dc14abf5e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2795,7 +2795,8 @@ void Client::send_reconnect(MetaSession *session) auto it = in->caps.find(mds); if (it != in->caps.end()) { if (allow_multi && - m->get_approx_size() >= (std::numeric_limits::max() >> 1)) { + m->get_approx_size() >= + static_cast((std::numeric_limits::max() >> 1))) { m->mark_more(); session->con->send_message2(std::move(m)); diff --git a/src/librbd/librbd.cc b/src/librbd/librbd.cc index d9b3ae9e23a00..b12404fcaaafc 100644 --- a/src/librbd/librbd.cc +++ b/src/librbd/librbd.cc @@ -2230,7 +2230,7 @@ namespace librbd { { ImageCtx *ictx = (ImageCtx *)ctx; tracepoint(librbd, discard_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len); - if (len > std::numeric_limits::max()) { + if (len > static_cast(std::numeric_limits::max())) { tracepoint(librbd, discard_exit, -EINVAL); return -EINVAL; } @@ -2247,7 +2247,7 @@ namespace librbd { ictx->read_only, ofs, len, bl.length() <= 0 ? NULL : bl.c_str(), bl.length(), op_flags); if (bl.length() <= 0 || len % bl.length() || - len > std::numeric_limits::max()) { + len > static_cast(std::numeric_limits::max())) { tracepoint(librbd, writesame_exit, -EINVAL); return -EINVAL; } @@ -5147,7 +5147,7 @@ extern "C" int rbd_discard(rbd_image_t image, uint64_t ofs, uint64_t len) librbd::ImageCtx *ictx = (librbd::ImageCtx *)image; tracepoint(librbd, discard_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len); - if (len > std::numeric_limits::max()) { + if (len > static_cast(std::numeric_limits::max())) { tracepoint(librbd, discard_exit, -EINVAL); return -EINVAL; } @@ -5166,7 +5166,7 @@ extern "C" ssize_t rbd_writesame(rbd_image_t image, uint64_t ofs, size_t len, ictx->read_only, ofs, len, data_len == 0 ? NULL : buf, data_len, op_flags); if (data_len == 0 || len % data_len || - len > std::numeric_limits::max()) { + len > static_cast(std::numeric_limits::max())) { tracepoint(librbd, writesame_exit, -EINVAL); return -EINVAL; } diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c66883867bd28..59b50cc68dd02 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1192,7 +1192,8 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) // which is obviously the hard part TBD.. vector pgs_to_check; tmp.get_upmap_pgs(&pgs_to_check); - if (pgs_to_check.size() < g_conf()->mon_clean_pg_upmaps_per_chunk * 2) { + if (pgs_to_check.size() < + static_cast(g_conf()->mon_clean_pg_upmaps_per_chunk * 2)) { // not enough pgs, do it inline tmp.clean_pg_upmaps(cct, &pending_inc); } else { -- 2.39.5