]> git-server-git.apps.pok.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:29:18 +0000 (13:29 +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 e11b773aa6c68b03122ef17d8c9d855dea238942..d0e1dd6aaab57d67bfa21b42427f7ad47c43a45a 100644 (file)
@@ -3020,9 +3020,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 8045f39c44963fa4e343195f32cdbf5c08e4a619..3fb57373b8254ff9aa4a4749039d161c30dd9040 100644 (file)
@@ -341,7 +341,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,