From dd901498c9e9eb30863699542cadecac003dd9d7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 10 Dec 2015 16:37:55 -0500 Subject: [PATCH] os/bluestore/BlueFS: simplify extent list Merge contiguous extents. Signed-off-by: Sage Weil --- src/os/bluestore/BlueFS.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index bda920b7e1f37..0321812d648cf 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -888,7 +888,10 @@ int BlueFS::_allocate(unsigned id, uint64_t len, vector *ev) &e.offset, &e.length); if (r < 0) return r; - ev->push_back(e); + if (!ev->empty() && ev->back().end() == e.offset) + ev->back().length += e.length; + else + ev->push_back(e); if (e.length >= left) break; left -= e.length; -- 2.39.5