]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: modify return type for BlueFS::_get_slow_device_id()
authorIgor Fedotov <ifedotov@suse.com>
Tue, 17 Mar 2020 18:22:56 +0000 (21:22 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Fri, 17 Apr 2020 10:42:40 +0000 (13:42 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit de79da6a065315eb92b203308598d4c452adcc75)

src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index 512a47b52a36609ad5988af280e4bb91276f0dcd..f66dc5b585471883fec40663a5b00013df79710f 100644 (file)
@@ -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(
index 439095f46793202db71ce2b8f7597e66a2e9b777..cc97db73aec16eae59e8d87a1b223deec348a2f0 100644 (file)
@@ -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,