Merge pull request #28732 from tchaikov/wip-32bit-size_t

osdc/Striper: specialize std::min<>

Reviewed-by: Neha Ojha <nojha@redhat.com>
This commit is contained in:
Kefu Chai 2019-07-05 11:07:05 +08:00 committed by GitHub
commit 3f6f85819f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -1354,7 +1354,7 @@ void BlueFS::_drop_link(FileRef file)
int BlueFS::_read_random(
FileReader *h, ///< [in] read from here
uint64_t off, ///< [in] offset
size_t len, ///< [in] this many bytes
uint64_t len, ///< [in] this many bytes
char *out) ///< [out] optional: or copy it here
{
auto* buf = &h->buf;
@ -1384,7 +1384,7 @@ int BlueFS::_read_random(
s_lock.unlock();
uint64_t x_off = 0;
auto p = h->file->fnode.seek(off, &x_off);
uint64_t l = std::min(p->length - x_off, static_cast<uint64_t>(len));
uint64_t l = std::min(p->length - x_off, len);
dout(20) << __func__ << " read random 0x"
<< std::hex << x_off << "~" << l << std::dec
<< " of " << *p << dendl;

View File

@ -375,7 +375,7 @@ private:
int _read_random(
FileReader *h, ///< [in] read from here
uint64_t offset, ///< [in] offset
size_t len, ///< [in] this many bytes
uint64_t len, ///< [in] this many bytes
char *out); ///< [out] optional: or copy it here
void _invalidate_cache(FileRef f, uint64_t offset, uint64_t length);

View File

@ -4160,7 +4160,7 @@ public:
return head.version == 0 && head.epoch == 0;
}
size_t approx_size() const {
uint64_t approx_size() const {
return head.version - tail.version;
}

View File

@ -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<size_t>(left, tlen);
if (actual > 0) {
ldout(cct, 20) << " s has " << actual << ", copying" << dendl;