[PATCH] os/bluestore/BlueFS: use uint64_t for `len`
authorKefu Chai <kchai@redhat.com>
Fri, 28 Jun 2019 03:35:54 +0000 (11:35 +0800)
committerMattias Ellert <mattias.ellert@physics.uu.se>
Thu, 26 Aug 2021 08:36:49 +0000 (09:36 +0100)
commit0d71ca1c99e1085f48995d9ea9d6114b0453d7ff
tree064be79ea990be0ae49453590697c81449aab175
parentb72dcc0266e9f8a108972701cf6b76b3ef1602a7
[PATCH] 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>
Gbp-Pq: Name bluefs-use-uint64_t-for-len.patch
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h