Skip to content

Commit

Permalink
Merge pull request ceph#18804 from majianpeng/bluestore-collection-pr…
Browse files Browse the repository at this point in the history
…ealloc

os/bluestore: Prealloc memory avoid realloc in list_collection.

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
tchaikov authored Feb 9, 2018
2 parents 7894961 + d3d04ab commit 34c3af4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7196,6 +7196,7 @@ int BlueStore::getattrs(
int BlueStore::list_collections(vector<coll_t>& ls)
{
RWLock::RLocker l(coll_lock);
ls.reserve(coll_map.size());
for (ceph::unordered_map<coll_t, CollectionRef>::iterator p = coll_map.begin();
p != coll_map.end();
++p)
Expand Down

0 comments on commit 34c3af4

Please sign in to comment.