]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osdc/Striper: specialize std::min<>
authorKefu Chai <kchai@redhat.com>
Tue, 25 Jun 2019 06:50:47 +0000 (14:50 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Jul 2019 06:03:51 +0000 (14:03 +0800)
commita4276e9a3b413a162b56e097595452f15edf34ce
treef739ac2ba42aaa6732285f7c8edbfc66fc1c8658
parent24ccb2f857d2a49e7266478a364a99b0e3c289e0
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<size_t>()` 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 <kchai@redhat.com>
src/osdc/Striper.cc