]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: prealloc/reserve extent vector for common alloc path
authorSage Weil <sage@redhat.com>
Tue, 17 Jan 2017 16:17:38 +0000 (11:17 -0500)
committerSage Weil <sage@redhat.com>
Tue, 17 Jan 2017 20:57:38 +0000 (15:57 -0500)
No need to worry about the gift/reclaim path--those are very rare.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit b0c243875fe963e2958828bef62f3ba55e123434)

src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc

index fa3a4fa6b6eb6c6211583090d02b7c01078fcaae..b9d7bf0568726e0e80965434fcf7feab180ebb8d 100644 (file)
@@ -1763,6 +1763,7 @@ int BlueFS::_allocate(uint8_t id, uint64_t len,
   }
 
   AllocExtentVector extents;
+  extents.reserve(4);
   int64_t alloc_len = alloc[id]->allocate(left, min_alloc_size, hint,
                           &extents);
   if (alloc_len < (int64_t)left) {
index 33d6a780f0ca679f4a8e2a2da4fe20a9f2ff96ae..36004808e84ed916c56f3c326deec2725bf0a8dc 100644 (file)
@@ -7873,6 +7873,7 @@ int BlueStore::_do_alloc_write(
     }
 
     AllocExtentVector extents;
+    extents.reserve(4);
     int64_t got = alloc->allocate(final_length, min_alloc_size, max_alloc_size,
                             hint, &extents);
     assert(got == (int64_t)final_length);