]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/bluestore/Blue(FS|Store): uint64_t alloc_size
authorBernd Zeimetz <bernd@bzed.de>
Sun, 5 Jan 2020 13:30:54 +0000 (14:30 +0100)
committerBernd Zeimetz <bernd@bzed.de>
Sun, 5 Jan 2020 13:40:15 +0000 (14:40 +0100)
commite56f2967be3a0e9c46c537955e6a0c9e419ab527
tree185ccfd2c5efaefc023fd27f2d1546aa58052a3f
parentacd4de57c407662bfbd9256f06b4477acc7a4556
os/bluestore/Blue(FS|Store): uint64_t alloc_size

Compiling on Debian's 32bit architectures failed with

<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:5539:37: error: no matching function for call to ‘p2align(size_t&, uint64_t&)’
 5539 |     total += p2align(len, alloc_size);
      |                                     ^
In file included from /<<PKGBUILDDIR>>/src/include/denc.h:42,
                 from /<<PKGBUILDDIR>>/src/include/encoding.h:40,
                 from /<<PKGBUILDDIR>>/src/include/compact_map.h:16,
                 from /<<PKGBUILDDIR>>/src/include/mempool.h:32,
                 from /<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.h:36,
                 from /<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:25:
/<<PKGBUILDDIR>>/src/include/intarith.h:57:20: note: candidate: ‘template<class T> constexpr T p2align(T, T)’
   57 | constexpr inline T p2align(T x, T align) {
      |                    ^~~~~~~
/<<PKGBUILDDIR>>/src/include/intarith.h:57:20: note:   template argument deduction/substitution failed:
/<<PKGBUILDDIR>>/src/os/bluestore/BlueStore.cc:5539:37: note:   deduced conflicting types for parameter ‘T’ (‘unsigned int’ and ‘long long unsigned int’)
 5539 |     total += p2align(len, alloc_size);

As far as I understand it the available_freespace should at least be
able to return the same number as alloc_size, so we should use uint64_t
instead of size_t here, similar to
10a953afc8f803e50c96354470fb114b33e62599

Fixes: https://tracker.ceph.com/issues/43451
Signed-off-by: Bernd Zeimetz <bernd@bzed.de>
src/os/bluestore/BlueFS.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h