Description: Misc fixes for 32 bit architecture builds. Author: James Page Forwarded: no --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -253,7 +253,8 @@ 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, @@ -268,7 +269,8 @@ // 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(); + static_cast( + matching_remote_snap_it->second.timestamp.sec()); } matching_remote_snap_it = m_state_builder->remote_image_ctx->snap_info.find( @@ -276,7 +278,8 @@ 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()); if (m_local_object_count > 0) { root_obj["syncing_percent"] = --- a/src/s3select/include/s3select_functions.h +++ b/src/s3select/include/s3select_functions.h @@ -585,7 +585,7 @@ struct _fn_diff_timestamp : public base_ { 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) { --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -3744,11 +3744,11 @@ int BlueFS::do_replay_recovery_read(File 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 --- a/src/tools/neorados.cc +++ b/src/tools/neorados.cc @@ -146,7 +146,7 @@ void create(R::RADOS& r, const std::vect 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::vecto 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 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; --- a/src/tools/cephfs_mirror/FSMirror.cc +++ b/src/tools/cephfs_mirror/FSMirror.cc @@ -334,7 +334,7 @@ void FSMirror::handle_acquire_directory( 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; @@ -352,7 +352,7 @@ void FSMirror::handle_release_directory( 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); --- a/src/librbd/object_map/DiffRequest.cc +++ b/src/librbd/object_map/DiffRequest.cc @@ -175,7 +175,7 @@ void DiffRequest::handle_load_object_ 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); --- 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;