]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: use uint64 for return value of size() 41042/head
authorKefu Chai <kchai@redhat.com>
Tue, 27 Apr 2021 12:37:32 +0000 (20:37 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Apr 2021 11:39:43 +0000 (19:39 +0800)
size_t is not necessarily an alias of uint64_t, so template argument
deduction would fail if we use `std::min(m_object_map.size(),
prev_object_diff_state_size)`. so better off using the same type for lhs
and rhs.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librbd/object_map/DiffRequest.cc

index a8331bc5afc47490be536917cebdac7f18c55832..ca341f78c2f28b151731c6699df8f4ecc309ef79 100644 (file)
@@ -175,7 +175,7 @@ void DiffRequest<I>::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);