From 74da0515f8f395ad0859bf2688b0086e1043b336 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Tue, 17 Mar 2020 21:22:56 +0300 Subject: [PATCH] os/bluestore: modify return type for BlueFS::_get_slow_device_id() Signed-off-by: Igor Fedotov (cherry picked from commit de79da6a065315eb92b203308598d4c452adcc75) --- src/os/bluestore/BlueFS.cc | 4 ++-- src/os/bluestore/BlueFS.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 512a47b52a366..f66dc5b585471 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2663,9 +2663,9 @@ int BlueFS::_expand_slow_device(uint64_t need, PExtentVector& extents) { int r = -ENOSPC; if (slow_dev_expander) { - int id = _get_slow_device_id(); + auto id = _get_slow_device_id(); auto min_alloc_size = alloc_size[id]; - ceph_assert(id <= (int)alloc.size() && alloc[id]); + ceph_assert(id <= alloc.size() && alloc[id]); auto min_need = round_up_to(need, min_alloc_size); need = std::max(need, slow_dev_expander->get_recommended_expansion_delta( diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index 439095f467932..cc97db73aec16 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -351,7 +351,9 @@ private: FileRef _get_file(uint64_t ino); void _drop_link(FileRef f); - int _get_slow_device_id() { return bdev[BDEV_SLOW] ? BDEV_SLOW : BDEV_DB; } + unsigned _get_slow_device_id() { + return bdev[BDEV_SLOW] ? BDEV_SLOW : BDEV_DB; + } const char* get_device_name(unsigned id); int _expand_slow_device(uint64_t min_size, PExtentVector& extents); int _allocate(uint8_t bdev, uint64_t len, -- 2.39.5