]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Improve ExtentMap::fault_range
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 16 Feb 2023 12:40:25 +0000 (12:40 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 10 May 2023 11:47:46 +0000 (11:47 +0000)
Make faster exit when sharding not enabled.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 6eb2f7c504764cc61f0dc25b4f435ee23c20e55c..43f6e0f345f3ce24b8d91f2cf48b5a58e9b2f7bf 100644 (file)
@@ -3342,13 +3342,15 @@ void BlueStore::ExtentMap::fault_range(
 {
   dout(30) << __func__ << " 0x" << std::hex << offset << "~" << length
           << std::dec << dendl;
+  if (shards.size() == 0) {
+    // no sharding yet; everyting is loaded
+    return;
+  }
   auto start = seek_shard(offset);
   auto last = seek_shard(offset + length);
-
-  if (start < 0)
-    return;
-
   ceph_assert(last >= start);
+  ceph_assert(start >= 0);
+
   string key;
   while (start <= last) {
     ceph_assert((size_t)start < shards.size());