From: Kefu Chai Date: Tue, 25 Jun 2019 06:50:47 +0000 (+0800) Subject: osdc/Striper: specialize std::min<> X-Git-Tag: v15.1.0~2289^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4276e9a3b413a162b56e097595452f15edf34ce;p=ceph.git osdc/Striper: specialize std::min<> on armhf, `unsigned int` is 32bit, and `size_t` is defined as `unsigned int`, so `std::min(a_size_t, a_uint32_t)` is not able to deduce the template parameter, so we need to either use a single type or specialize this template. because `actual` will eventually used as a parameter of `buffer::list::splice(unsigned, unsigned, buffer::list)`, it's at least not worse to use `std::min()` on a 32-bit system. on a LP64 system, `actual` will be casted to `unsigned` when calling `bl.splice()` with or without this change. Signed-off-by: Kefu Chai --- diff --git a/src/osdc/Striper.cc b/src/osdc/Striper.cc index 5c5b4cb7d72e..e8232f125c1d 100644 --- a/src/osdc/Striper.cc +++ b/src/osdc/Striper.cc @@ -406,7 +406,7 @@ void Striper::StripedReadResult::add_partial_sparse_result( ceph_assert(s->first <= *bl_off); size_t left = (s->first + s->second) - *bl_off; - size_t actual = std::min(left, tlen); + size_t actual = std::min(left, tlen); if (actual > 0) { ldout(cct, 20) << " s has " << actual << ", copying" << dendl;