File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1073,7 +1073,7 @@ RandomBlockOolWriter::do_write(
10731073
10741074 // TODO : allocate a consecutive address based on a transaction
10751075 if (writes.size () != 0 &&
1076- writes.back ().offset + writes.back ().bp . length () == paddr) {
1076+ writes.back ().offset + writes.back ().get_mergeable_length () == paddr) {
10771077 // We can write both the currrent extent and the previous one at once
10781078 // if the extents are located in a row
10791079 if (writes.back ().mergeable_bps .size () == 0 ) {
Original file line number Diff line number Diff line change @@ -195,6 +195,17 @@ class RandomBlockOolWriter : public ExtentOolWriter {
195195 ceph::bufferptr bp;
196196 RandomBlockManager* rbm;
197197 std::list<ceph::bufferptr> mergeable_bps;
198+
199+ extent_len_t get_mergeable_length () const {
200+ if (mergeable_bps.size () == 0 ) {
201+ return bp.length ();
202+ }
203+ extent_len_t len = 0 ;
204+ for (auto &p : mergeable_bps) {
205+ len += p.length ();
206+ }
207+ return len;
208+ }
198209 };
199210 alloc_write_iertr::future<> do_write (
200211 Transaction& t,
You can’t perform that action at this time.
0 commit comments