From: James Page Date: Mon, 10 Jan 2022 10:45:19 +0000 (+0000) Subject: Misc fixes for 32 bit architecture builds. X-Git-Tag: archive/raspbian/16.2.7+ds-4+rpi1~2^2^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2e29d7862114cced69a0b194f06cf328367c5c7a;p=ceph.git Misc fixes for 32 bit architecture builds. Forwarded: no Gbp-Pq: Name 32bit-fixes.patch --- diff --git a/src/SimpleRADOSStriper.cc b/src/SimpleRADOSStriper.cc index d6fe101f9..b85cf4171 100644 --- a/src/SimpleRADOSStriper.cc +++ b/src/SimpleRADOSStriper.cc @@ -140,7 +140,7 @@ int SimpleRADOSStriper::remove() return 0; } -int SimpleRADOSStriper::truncate(uint64_t size) +int SimpleRADOSStriper::truncate(size_t size) { d(5) << size << dendl; diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 31154c96f..9f6129b58 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2272,7 +2272,7 @@ MEMPOOL_DEFINE_OBJECT_FACTORY(buffer::raw_static, buffer_raw_static, void ceph::buffer::list::page_aligned_appender::_refill(size_t len) { const size_t alloc = \ - std::max((size_t)min_alloc, (len + CEPH_PAGE_SIZE - 1) & CEPH_PAGE_MASK); + std::max((size_t)min_alloc, (size_t)((len + CEPH_PAGE_SIZE - 1) & CEPH_PAGE_MASK)); auto new_back = \ ptr_node::create(buffer::create_page_aligned(alloc)); new_back->set_length(0); // unused, so far. diff --git a/src/librbd/object_map/DiffRequest.cc b/src/librbd/object_map/DiffRequest.cc index 566e98ac0..606d48bbf 100644 --- a/src/librbd/object_map/DiffRequest.cc +++ b/src/librbd/object_map/DiffRequest.cc @@ -175,7 +175,7 @@ void DiffRequest::handle_load_object_map(int r) { m_object_map.resize(num_objs); } - size_t prev_object_diff_state_size = m_object_diff_state->size(); + uint64_t prev_object_diff_state_size = m_object_diff_state->size(); if (prev_object_diff_state_size < num_objs) { // the diff state should be the largest of all snapshots in the set m_object_diff_state->resize(num_objs); diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 37a000ac6..f48758e7a 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -3787,11 +3787,11 @@ int BlueFS::do_replay_recovery_read(FileReader *log_reader, size_t BlueFS::probe_alloc_avail(int dev, uint64_t alloc_size) { - size_t total = 0; - auto iterated_allocation = [&](size_t off, size_t len) { + uint64_t total = 0; + auto iterated_allocation = [&](uint64_t off, uint64_t len) { //only count in size that is alloc_size aligned - size_t dist_to_alignment; - size_t offset_in_block = off & (alloc_size - 1); + uint64_t dist_to_alignment; + uint64_t offset_in_block = off & (alloc_size - 1); if (offset_in_block == 0) dist_to_alignment = 0; else diff --git a/src/s3select/include/s3select_functions.h b/src/s3select/include/s3select_functions.h index 77b3db3a7..9abc72a6e 100644 --- a/src/s3select/include/s3select_functions.h +++ b/src/s3select/include/s3select_functions.h @@ -585,7 +585,7 @@ struct _fn_diff_timestamp : public base_function { boost::gregorian::date_period dp = boost::gregorian::date_period( val_dt1.timestamp()->date(), val_dt2.timestamp()->date()); - result->set_value( dp.length().days() ); + result->set_value( (int64_t)dp.length().days() ); } else if (strcmp(val_date_part.str(), "hours") == 0) { diff --git a/src/tools/cephfs_mirror/FSMirror.cc b/src/tools/cephfs_mirror/FSMirror.cc index 76dcc11f6..9e9cfe727 100644 --- a/src/tools/cephfs_mirror/FSMirror.cc +++ b/src/tools/cephfs_mirror/FSMirror.cc @@ -345,7 +345,7 @@ void FSMirror::handle_acquire_directory(string_view dir_path) { std::scoped_lock locker(m_lock); m_directories.emplace(dir_path); m_service_daemon->add_or_update_fs_attribute(m_filesystem.fscid, SERVICE_DAEMON_DIR_COUNT_KEY, - m_directories.size()); + static_cast(m_directories.size())); for (auto &[peer, peer_replayer] : m_peer_replayers) { dout(10) << ": peer=" << peer << dendl; @@ -363,7 +363,7 @@ void FSMirror::handle_release_directory(string_view dir_path) { if (it != m_directories.end()) { m_directories.erase(it); m_service_daemon->add_or_update_fs_attribute(m_filesystem.fscid, SERVICE_DAEMON_DIR_COUNT_KEY, - m_directories.size()); + static_cast(m_directories.size())); for (auto &[peer, peer_replayer] : m_peer_replayers) { dout(10) << ": peer=" << peer << dendl; peer_replayer->remove_directory(dir_path); diff --git a/src/tools/neorados.cc b/src/tools/neorados.cc index 516dfbce7..822335d51 100644 --- a/src/tools/neorados.cc +++ b/src/tools/neorados.cc @@ -146,7 +146,7 @@ void create(R::RADOS& r, const std::vector& p, obj, pname)); } -inline constexpr std::size_t io_size = 4 << 20; +inline constexpr std::uint64_t io_size = 4 << 20; void write(R::RADOS& r, const std::vector& p, s::yield_context y) { @@ -156,7 +156,7 @@ void write(R::RADOS& r, const std::vector& p, s::yield_context y) bs::error_code ec; std::unique_ptr buf = std::make_unique(io_size); - std::size_t off = 0; + std::uint64_t off = 0; boost::io::ios_exception_saver ies(std::cin); std::cin.exceptions(std::istream::badbit); @@ -203,7 +203,7 @@ void read(R::RADOS& r, const std::vector& p, s::yield_context y) obj, pname)); } - std::size_t off = 0; + std::uint64_t off = 0; ceph::buffer::list bl; while (auto toread = std::max(len - off, io_size)) { R::ReadOp op; diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index e94ec71df..ae7581c8b 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -253,7 +253,8 @@ bool Replayer::get_replay_status(std::string* description, json_spirit::mObject root_obj; root_obj["replay_state"] = replay_state; - root_obj["remote_snapshot_timestamp"] = remote_snap_info->timestamp.sec(); + root_obj["remote_snapshot_timestamp"] = static_cast( + remote_snap_info->timestamp.sec()); auto matching_remote_snap_id = util::compute_remote_snap_id( m_state_builder->local_image_ctx->image_lock, @@ -267,8 +268,8 @@ bool Replayer::get_replay_status(std::string* description, // use the timestamp from the matching remote image since // the local snapshot would just be the time the snapshot was // synced and not the consistency point in time. - root_obj["local_snapshot_timestamp"] = - matching_remote_snap_it->second.timestamp.sec(); + root_obj["local_snapshot_timestamp"] = static_cast( + matching_remote_snap_it->second.timestamp.sec()); } matching_remote_snap_it = m_state_builder->remote_image_ctx->snap_info.find( @@ -276,7 +277,8 @@ bool Replayer::get_replay_status(std::string* description, if (m_remote_snap_id_end != CEPH_NOSNAP && matching_remote_snap_it != m_state_builder->remote_image_ctx->snap_info.end()) { - root_obj["syncing_snapshot_timestamp"] = remote_snap_info->timestamp.sec(); + root_obj["syncing_snapshot_timestamp"] = static_cast( + remote_snap_info->timestamp.sec()); root_obj["syncing_percent"] = static_cast( 100 * m_local_mirror_snap_ns.last_copied_object_number / static_cast(std::max(1U, m_local_object_count)));