]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/BlueFS: use uint64_t for `len`
authorKefu Chai <kchai@redhat.com>
Fri, 28 Jun 2019 03:35:54 +0000 (11:35 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Jul 2019 06:03:51 +0000 (14:03 +0800)
commit10a953afc8f803e50c96354470fb114b33e62599
tree168179d1cd6dd9b779ef103dcecdbb0dc4c3338c
parenta4276e9a3b413a162b56e097595452f15edf34ce
os/bluestore/BlueFS: use uint64_t for `len`

change the type of parameter `len` of `BlueFS::_read_random()` from
`size_t` to `uint64_t`.

i think the type of `size_t` comes from
`rocksdb::RandomAccessFile::Read(uint64_t offset, size_t n,
rocksdb::Slice* result, char* scratch)`. and when we implement this
method, we continued using `n`'s type. but, we are using it with
`std::min()`, for instance, where the template parameter type deduction
fails if the lhs and rhs parameters' types are different. so probaly the
better solution is to use `uint64_t` directly to avoid the the cast and
specializing the template.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h